Example use of I2CTransaction class. In this example, the master mbed is talking to 3 legs of the SIPPC3B robot.

Revision:
7:c164b4869f74
Parent:
6:a52ded837184
Child:
8:402f4a307d08
--- a/LegInterface.h	Tue Aug 05 21:53:59 2014 +0000
+++ b/LegInterface.h	Tue Nov 11 23:01:02 2014 +0000
@@ -2,7 +2,7 @@
 #define LEGINTERFACE_H
 #include "I2CTransaction.h"
 #include "leg_packets.h"
-
+#include "robot_config.h"
 
 
 
@@ -24,13 +24,18 @@
     static const float FRONT_LEG_ANGLE = 130;  // Degrees
 
     // Distance from center of robot to wheel
-    static const float ROBOT_RADIUS = 0.4702;  // m
+    //static const float ROBOT_RADIUS = 0.4702;  // m
 
     // Number of A2D ticks per meter.  TODO: is 4096 right?
     static const float LIFT_TICKS_PER_METER = 4096 / 0.1;
 
     // Offset between measured height and true height (m)
-    static const float LIFT_OFFSET = 0.01;
+    //static const float LIFT_OFFSET = 0.01;
+#if (ROBOT_CONFIG_LEG_SYMMETRY == 0)
+    static const float LIFT_OFFSET = 0.015;
+#else
+    static const float LIFT_OFFSET = -0.005;
+#endif
 
     LegInterface(Serial *pc = NULL);
 
@@ -38,6 +43,7 @@
     bool queryStateInitiate();
     bool queryStateCompleted();
     bool queryStateSuccess();
+    void queryStateReportMagic();
     bool queryEstopCompleted();
     bool queryEstopSuccess();
     bool queryStateWaitForCompletion(int timeout = 1000);