7 #include "RbDynamixelServo.h"
13 namespace RobotIOControls
52 unsigned int m_iLastGetRegisterID;
55 unsigned int m_iLastGetRegisterValue;
57 virtual void WriteGoalPosition(
int iServoID,
int iPos);
58 virtual int ReadGoalPosition(
int iServoID) {
return m_iLastGoalPos;};
59 virtual int ReadPresentPosition(
int iServoID) {
return m_iPresentPos;};
61 virtual void WriteMovingSpeed(
int iServoID,
int iVelocity);
62 virtual int ReadMovingSpeed(
int iServoID) {
return m_iLastGoalVelocity;};
63 virtual int ReadPresentSpeed(
int iServoID) {
return m_iPresentVelocity;};
65 virtual int ReadPresentLoad(
int iServoID) {
return m_iLoad;};
66 virtual int ReadPresentVoltage(
int iServoID) {
return m_iVoltage;};
67 virtual int ReadPresentTemperature(
int iServoID) {
return m_iTemperature;};
68 virtual int ReadIsMoving(
int iServoID);
69 virtual int ReadLED(
int iServoID);
70 virtual int ReadAlarmShutdown(
int iServoID);
71 virtual int ReadModelNumber(
int iServoID) {
return m_iModelNum;};
72 virtual int ReadID(
int iServoID) {
return m_iServoID;};
73 virtual int ReadFirmwareVersion(
int iServoID) {
return m_iFirmwareVersion;};
75 virtual void WriteCWComplianceMargin(
int iServoID,
int iVal);
76 virtual int ReadCWComplianceMargin(
int iServoID) {
return m_iCWComplianceMargin;}
78 virtual void WriteCCWComplianceMargin(
int iServoID,
int iVal);
79 virtual int ReadCCWComplianceMargin(
int iServoID) {
return m_iCCWComplianceMargin;}
81 virtual void WriteCWComplianceSlope(
int iServoID,
int iVal);
82 virtual int ReadCWComplianceSlope(
int iServoID) {
return m_iCWComplianceSlope;}
84 virtual void WriteCCWComplianceSlope(
int iServoID,
int iVal);
85 virtual int ReadCCWComplianceSlope(
int iServoID) {
return m_iCCWComplianceSlope;}
87 virtual void WriteMaxTorque(
int iServoID,
int iVal);
88 virtual int ReadMaxTorque(
int iServoID) {
return m_iMaxTorque;};
90 virtual void WriteReturnDelayTime(
int iServoID,
int iVal);
91 virtual int ReadReturnDelayTime(
int iServoID) {
return m_iReturnDelayTime;};
93 virtual void WriteCCWAngleLimit(
int iServoID,
int iVal);
94 virtual int ReadCCWAngleLimit(
int iServoID) {
return m_iCCWAngleLimit;};
96 virtual void WriteCWAngleLimit(
int iServoID,
int iVal);
97 virtual int ReadCWAngleLimit(
int iServoID) {
return m_iCWAngleLimit;};
99 virtual void WriteTorqueLimit(
int iServoID,
int iVal);
100 virtual int ReadTorqueLimit(
int iServoID) {
return m_iTorqueLimit;};
102 boost::signals2::connection m_EDynamixelReceived;
103 boost::signals2::connection m_EDynamixelTransmitError;
104 boost::signals2::connection m_EDynamixelGetRegister;
106 virtual void DynamixelRecieved(
const int &iServoID);
107 virtual void DynamixelTransmitError(
const int &iCmd,
const int &iServoID);
108 virtual void DynamixelGetRegister(
const unsigned char &iServoID,
const unsigned char &iReg,
const unsigned int &iValue);
110 virtual void AddMotorUpdate(
int iPos,
int iSpeed);
111 virtual void UpdateMotorData();
112 virtual void UpdateAllMotorData();
113 virtual void UpdateKeyMotorData();
115 virtual void SetRegister(
unsigned char reg,
unsigned char length,
unsigned int value);
116 virtual int GetRegister(
unsigned char reg,
unsigned char length);
118 virtual void Move(
float fltPos,
float fltVel);
120 virtual void ConfigureServo();
123 RbFirmataDynamixelServo();
124 virtual ~RbFirmataDynamixelServo();
128 virtual void IOComponentID(
int iID);
130 virtual float QuantizeServoPosition(
float fltPos);
131 virtual float QuantizeServoVelocity(
float fltVel);
135 virtual void InitMotorData();
136 virtual void ShutdownMotor();
137 virtual void WaitForMoveToFinish();
139 #pragma region DataAccesMethods
141 virtual float *GetDataPointer(
const std::string &strDataType);
142 virtual bool SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError =
true);
143 virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
147 virtual void Initialize();
148 virtual void StepSimulation();
149 virtual void ResetSimulation();
151 virtual void MicroSleep(
unsigned int iTime);
152 virtual Simulator *GetSimulator();
153 virtual void SetupIO();
154 virtual void StepIO(
int iPartIdx);
155 virtual void ShutdownIO();
unsigned long long m_lStartServoUpdateTick
The tick when we start a servo update.
int m_iModelNum
Keeps track of the servos model number. This is updated once at the start of the sim and then used th...
int m_iFirmwareVersion
Keeps track of the servos firmware version. This is updated once at the start of the sim and then use...
A standard xml manipulation class.
virtual bool IsMotorControl()
Returns true if this part interface is for controlling a motor.
int m_iIsMoving
Keeps track of whether this servo is moving.
int m_iLED
Keeps track of LED Status.
int m_iCCWAngleLimit
Keeps track of the counter-clockwise limit.
int m_iReturnDelayTime
Keeps track of the servos return delay time.
int m_iTorqueLimit
Keeps track of the torque limit.
int m_iAlarm
Keeps track of alarm Status.
int m_iCWAngleLimit
Keeps track of the clockwise limit.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.