1 #ifndef EAGLE_EBOARD_HELPLIB_AX12SERVO 2 #define EAGLE_EBOARD_HELPLIB_AX12SERVO 48 #if EBOARD_USE_UTILITY > 0x0 64 inline void changeMotorID(
optVAL_t newID);
70 inline void setPositionMode(
void);
76 inline void setSpeedMode(
void);
84 inline void ledOff(
void);
86 inline void ledOn(
void);
88 inline void setTorque(uint16_t);
148 #if EBOARD_USE_UTILITY > 0x0 149 void AX12Servo::setID(
optVAL_t newID) {this->
id = newID;_servoHandler.SetServoLimit(this->
id,_servoHandler.upperLimit_temp);}
150 void AX12Servo::changeMotorID(
optVAL_t newID) {this->
id = newID; _servoHandler.SetID(this->
id, newID);}
152 void AX12Servo::setPositionMode(
void) {}
153 void AX12Servo::setSpeedMode(
void) {}
154 void AX12Servo::setSpeed(
optVAL_t) {}
155 void AX12Servo::ledOff(
void) {}
156 void AX12Servo::ledOn(
void) {}
157 void AX12Servo::setTorque(uint16_t) {}
161 #if EBOARD_CLAMP > 0x0 162 if(pos>1023 || speed > 1023)
return;
164 speed = speed*600/1023 - 300;
165 pos = pos *600/1023 - 300;
168 if(pos>300 || speed > 300)
return;
171 if(speed !=
actSpe){ _servoHandler.setVelocity(speed); this->
actSpe=speed;}
172 _servoHandler.write(this->
id,pos);
int actPos
stores the actual pos or move-to pos of the AX12Servo
[COPY&PASTE] This is the AX12Servo ghost struct :D
void storePosition(int pos, int speed=0x3FF)
This saves the Servo Position.
int actSpe
stores the actual 'would use speed' of the AX12Servo
optVAL_t getPosition(void)
This "kind of" returns the Servo-Position.
bool isMoving(void)
Use this if you wan't to have a nice way of writing false.
int storedPos
stores the position the Servo should go to DynamixelBoard::action()
optVAL_t id
stores the id of the AX12Servo obejct
int storedSpe
stores the Speed of the Servo DynamixelBoard::action()
[COPY&PASTE] This is the DynamixelBoard ghost struct :D
DynamixelBoard * _conBoard
AX12Servo(void)
The constructor.
void setPosition(int pos, int speed=0x3FF)
This moves the Servo to the new position.
DynamixelBoard dBoard(board)
the dBoard object