HeRoS: read out and log joint angles and force sensor data from the leg test bench.

Dependencies:   AS5048 LCM101 MODSERIAL PinDetect SDFileSystem mbed

Revision:
0:3855d4588f76
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bench.h	Fri Dec 01 11:14:38 2017 +0000
@@ -0,0 +1,52 @@
+#ifndef _BENCH02_H_
+#define _BENCH02_H_
+
+#include "mbed.h"
+#include "as5048.h"
+#include "lcm101.h"
+#include "constants.h"
+
+/**
+ * Class to read out sensory information from the second test bench;
+ * the upper and lower leg, foot en toe setup with 1-dof hinges,
+ * each of which is equipped with an AMS AS5048 absolute rotary sensor.
+ * The sensors are daisy chained and communicate via SPI
+ */
+class Bench {
+public:
+    
+    static const float kCutOffDegrees = 180.0f;
+    static const float kCutOffRadians = 3.14159265359f;
+    
+    enum Joint {
+        TOES,
+        ANKLE,
+        KNEE,
+        HIP
+    };
+
+    Bench(PinName mosi, PinName miso, PinName sck, PinName cs, PinName p_lcm101);
+    
+    void Update();
+
+    float getDegrees(int i_joint);
+    float getDegrees(Joint joint);
+
+    float getRadians(int i_joint);
+    float getRadians(Joint joint);
+
+
+    const char* getJointName(int i_joint);
+    const char* getJointName(Joint joint);
+
+    float getForce();
+    
+    As5048* get_as5048();
+
+
+private:
+    As5048 as5048_;
+    Lcm101 lcm101_;
+};
+
+#endif
\ No newline at end of file