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

Dependencies:   AS5048 LCM101 MODSERIAL PinDetect SDFileSystem mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bench.h Source File

bench.h

00001 #ifndef _BENCH02_H_
00002 #define _BENCH02_H_
00003 
00004 #include "mbed.h"
00005 #include "as5048.h"
00006 #include "lcm101.h"
00007 #include "constants.h"
00008 
00009 /**
00010  * Class to read out sensory information from the second test bench;
00011  * the upper and lower leg, foot en toe setup with 1-dof hinges,
00012  * each of which is equipped with an AMS AS5048 absolute rotary sensor.
00013  * The sensors are daisy chained and communicate via SPI
00014  */
00015 class Bench {
00016 public:
00017     
00018     static const float kCutOffDegrees = 180.0f;
00019     static const float kCutOffRadians = 3.14159265359f;
00020     
00021     enum Joint {
00022         TOES,
00023         ANKLE,
00024         KNEE,
00025         HIP
00026     };
00027 
00028     Bench(PinName mosi, PinName miso, PinName sck, PinName cs, PinName p_lcm101);
00029     
00030     void Update();
00031 
00032     float getDegrees(int i_joint);
00033     float getDegrees(Joint joint);
00034 
00035     float getRadians(int i_joint);
00036     float getRadians(Joint joint);
00037 
00038 
00039     const char* getJointName(int i_joint);
00040     const char* getJointName(Joint joint);
00041 
00042     float getForce();
00043     
00044     As5048* get_as5048();
00045 
00046 
00047 private:
00048     As5048 as5048_;
00049     Lcm101 lcm101_;
00050 };
00051 
00052 #endif