HeRoS: read out and log joint angles and force sensor data from the leg test bench. Now with additional features to read pressure sensors and set the null values of the pressure and force sensors

Dependents:   heros_leg_readout_torque_addition heros_leg_readout_torque_addition_V3

Fork of LCM101 by K K

Revision:
3:22f8cfcad8d6
Parent:
2:77cffacfd89e
Child:
4:f7af875abe50
--- a/lcm101.h	Tue Jun 05 08:48:06 2018 +0000
+++ b/lcm101.h	Fri Oct 12 12:09:59 2018 +0000
@@ -41,6 +41,15 @@
     }
     
     /**
+     * sets force scaling offset so that current output is force zero
+     */
+    void nullForce()
+    {
+        kOffset_ = kOffset_ - getForce();
+        return;        
+    }
+    
+    /**
      * @return ffset of analog value
      */
     float get_offset() { return kOffset_; }
@@ -54,7 +63,7 @@
 private:
     AnalogIn analog_in_;
     
-    const float kOffset_;
+    float kOffset_;
     const float kFactor_;
 };