Provides an interface to an AX-12A servo. Requires the Dynamixel bus protocol library/
Fork of AX-12A by
Diff: AX12.h
- Revision:
- 3:7b970151bf19
- Parent:
- 1:d7642b2e155d
- Child:
- 5:bae6dc62dfb4
--- a/AX12.h Tue Dec 15 04:37:54 2015 +0000 +++ b/AX12.h Wed Dec 23 18:32:37 2015 +0000 @@ -21,7 +21,7 @@ #include "mbed.h" #include "DynamixelBus.h" - +#include "RobotNode.h" enum ControlTable { @@ -77,7 +77,7 @@ ctPunchH = 49 // RD/WR }; -class AX12 +class AX12 : public RobotNode { public: @@ -86,7 +86,7 @@ // returns the status of the servo (connected/not connected + errors) StatusCode Ping(); - // Sets toe goal position of the servo in degrees + // Sets the goal position of the servo in degrees StatusCode SetGoal(float degrees); // determines if the servo is moving @@ -104,8 +104,41 @@ // enables/disables holding torque StatusCode TorqueEnable( bool ); + // check if measure available + virtual bool HasMeasure(int measureId); + + // get normalized measure value + virtual float GetMeasure(int measureId); + + // get normalized measure value + virtual float GetLastMeasure(int measureId); + + // do action + virtual bool DoAction(int actionId, float actionValue); + + // check if has action + virtual bool HasAction(int actionId); + + // get last error + virtual unsigned char GetLastError(); + + // get node type + virtual NodePartType GetNodeType(); + private : ServoId _ID; DynamixelBus* _pbus; + + // last read temperature + int _LastTemperature; + + // last read position + float _LastPosition; + + // last read voltage + float _LastVoltage; + + unsigned char _LastError; + }; #endif