2014 Eurobot fork

Dependencies:   mbed-rtos mbed QEI

Revision:
77:8d83a0c00e66
Parent:
72:7996aa8286ae
Parent:
76:532d9bc1d2aa
Child:
81:ef1ce4f5322b
diff -r 265d3cc6b0b1 -r 8d83a0c00e66 Processes/Motion/motion.cpp
--- a/Processes/Motion/motion.cpp	Mon Apr 15 13:44:49 2013 +0000
+++ b/Processes/Motion/motion.cpp	Mon Apr 15 15:30:12 2013 +0000
@@ -44,7 +44,7 @@
 };
 
 // local copy of the current active motion
-motion_cmd current_motion;
+motion_cmd current_motion = {motion_waypoint, 0, false, NULL};
 
 Waypoint target_waypoint = {0,0,0,0,0}; //local wp copy, TODO: fix and make a shared local memory pool for any movement cmd to be copied to
 
@@ -132,10 +132,10 @@
     
     
     // forward velocity controller
-    const float p_gain_fv = 1;//0.7; //TODO: tune
+    const float p_gain_fv = 0.9;//0.7; //TODO: tune
     
     float max_fv = 0.3;//0.2; // meters per sec //TODO: tune
-    float max_fv_reverse = 0.05; //TODO: tune
+    float max_fv_reverse = 0.03; //TODO: tune
     const float angle_envelope_exponent = 32;//512; //8.0; //TODO: tune
     
     // control, distance_err in meters
@@ -146,7 +146,7 @@
         max_fv = max_fv_reverse;
     
     // control the forward velocity envelope based on angular error
-    max_fv = max_fv * pow(cos(angle_err_saved/2), angle_envelope_exponent);
+    max_fv = max_fv * pow(cos(angle_err_saved/2), /*angle_envelope_exponent*/target_waypoint.angle_exponent); //temp hack
     
     // constrain range
     if (forward_v > max_fv)
@@ -186,7 +186,6 @@
     current_motion.setter_tid = setter_tid_in;
     current_motion.motion_type = motion_waypoint;
 
-    //current_motion.wp_ptr = new_wp; //TODO: need to make local copy or edits to mem ptr contents screw motion over
     target_waypoint = *new_wp;
 }