This is the quartic polynomial gait.

Dependents:   Motion-Control

Files at this revision

API Documentation at this revision

Comitter:
perr1940
Date:
Mon Jun 29 17:25:21 2015 +0000
Parent:
3:ed0f6f302a0a
Commit message:
Removed pc. Moving on to test rig testing.

Changed in this revision

Brad_poly_gait.cpp Show annotated file Show diff for this revision Revisions of this file
Brad_poly_gait.h Show annotated file Show diff for this revision Revisions of this file
--- a/Brad_poly_gait.cpp	Mon Jun 29 17:22:57 2015 +0000
+++ b/Brad_poly_gait.cpp	Mon Jun 29 17:25:21 2015 +0000
@@ -8,7 +8,7 @@
 
 /** Swing trajectory generation
 */
-BradPolySwing::BradPolySwing(Brad_poly_gait_t& p):_params(&p),_blend(), _blend_steps(0), _current_poly(0), _tau(0), pc(USBTX,USBRX), TrajectoryGenerator()
+BradPolySwing::BradPolySwing(Brad_poly_gait_t& p):_params(&p),_blend(), _blend_steps(0), _current_poly(0), _tau(0), TrajectoryGenerator()
 {
     //_phi{{0, 1, 2, 3, 4}, {0, 1, 2, 3, 4}},
     /*_phi[0][0]=-22;
@@ -25,11 +25,10 @@
     _times[0]=0;
     _times[1]=378;
     _times[2]=900;*/
-    pc.baud(921600);
     calculate_phi();
 };
 
-BradPolySwing::BradPolySwing():_blend(), _blend_steps(0), _current_poly(0), _tau(0), pc(USBTX,USBRX), TrajectoryGenerator()
+BradPolySwing::BradPolySwing():_blend(), _blend_steps(0), _current_poly(0), _tau(0), TrajectoryGenerator()
 {
     //_phi{{0, 1, 2, 3, 4}, {0, 1, 2, 3, 4}},
     _phi[0][0]=-22;
@@ -46,7 +45,6 @@
     _times[0]=0;
     _times[1]=378;
     _times[2]=900;
-    pc.baud(921600);
 };
 
 bool BradPolySwing::calculate(int time, float &value)
@@ -55,10 +53,6 @@
         _blend.increment(value);
     } else {
         float tau=convert_to_tau(time);
-        /*pc.printf("%f, ", tau);
-        for(int ii=0; ii<5; ii++) {
-            pc.printf("%f, ", _phi[ii][_current_poly]);
-        }*/
         value=_phi[0][_current_poly]+_phi[1][_current_poly]*tau+_phi[2][_current_poly]*tau*tau+_phi[3][_current_poly]*tau*tau*tau+_phi[4][_current_poly]*tau*tau*tau*tau;
     }
 
@@ -123,7 +117,7 @@
 
 /** Stance trajectory generation
 */
-BradPolyStance::BradPolyStance(Brad_poly_gait_t& p):_params(&p),_blend(), _blend_steps(0), _current_poly(0), _tau(0), pc(USBTX,USBRX), TrajectoryGenerator()
+BradPolyStance::BradPolyStance(Brad_poly_gait_t& p):_params(&p),_blend(), _blend_steps(0), _current_poly(0), _tau(0), TrajectoryGenerator()
 {
     /*_phi[0][0]=10;
     _phi[0][1]=0;
@@ -132,11 +126,10 @@
     _phi[0][4]=0;
     _times[0]=0;
     _times[1]=900;*/
-    pc.baud(921600);
     calculate_phi();
 };
 
-BradPolyStance::BradPolyStance():_blend(), _blend_steps(0), _current_poly(0), _tau(0), pc(USBTX,USBRX), TrajectoryGenerator()
+BradPolyStance::BradPolyStance():_blend(), _blend_steps(0), _current_poly(0), _tau(0), TrajectoryGenerator()
 {
     _phi[0][0]=10;
     _phi[1][0]=0;
@@ -145,7 +138,6 @@
     _phi[4][0]=0;
     _times[0]=0;
     _times[1]=900;
-    pc.baud(921600);
 };
 
 bool BradPolyStance::calculate(int time, float &value)
@@ -154,10 +146,6 @@
         _blend.increment(value);
     } else {
         float tau=convert_to_tau(time);
-        /*pc.printf("%f, ", tau);
-        for(int ii=0; ii<5; ii++) {
-            pc.printf("%f, ", _phi[ii][_current_poly]);
-        }*/
         value=_phi[0][_current_poly]+_phi[1][_current_poly]*tau+_phi[2][_current_poly]*tau*tau+_phi[3][_current_poly]*tau*tau*tau+_phi[4][_current_poly]*tau*tau*tau*tau;
     }
     if(time>_params->time_steps) {
--- a/Brad_poly_gait.h	Mon Jun 29 17:22:57 2015 +0000
+++ b/Brad_poly_gait.h	Mon Jun 29 17:25:21 2015 +0000
@@ -2,7 +2,6 @@
 #define BRADGAIT_H
 #include "gait_generator.h"
 #include "blend_generator.h"
-#include "mbed.h"
 
 //TODO: Add time_steps calculation in another file (App input should be a time in seconds)
 //TODO: Add peak_time calculation in another file (App input should be a fraction)
@@ -112,8 +111,6 @@
     /**Normalized time */
     float _tau;
 
-    /**Debugging*/
-    Serial pc;
 
 };
 
@@ -180,8 +177,6 @@
     /**Normalized time */
     float _tau;
 
-    /**Debugging*/
-    Serial pc;
 };
 
 /** A class that defines the first step swing trajectory per Michael McKinley's design.