eBoard ๐Ÿ‰  โ‘ โ‘งโ‘จ
Written for SIA 2017/2018
AX12Servo Struct Reference

[COPY&PASTE] This is the AX12Servo ghost struct :D More...

#include <eBoard.h>

+ Collaboration diagram for AX12Servo:

Public Member Functions

 AX12Servo (void)
 The constructor. More...
 
 AX12Servo (DynamixelBoard &dBoard, optVAL_t servoID)
 The constructor. More...
 
void setID (optVAL_t newID)
 change the AX-12 Servo this object should speak to More...
 
void changeMotorID (optVAL_t newID)
 change the hardwareID of this AX-12 Servo and will continue speaking to the new [reconnection recommended] More...
 
void setPositionMode (void)
 set the AX-12 Servo to positionMode More...
 
void setSpeedMode (void)
 set the AX-12 Servo NOT to speedMode More...
 
void setSpeed (optVAL_t)
 ๐Ÿ”ง I prevent errors! More...
 
void ledOff (void)
 Noone needs the AX-12 Servo LED^^. More...
 
void ledOn (void)
 Noone needs the AX-12 Servo LED^^. More...
 
void setTorque (uint16_t)
 ๐Ÿ”ง I prevent errors! More...
 
void setPosition (int pos, int speed=0x3FF)
 This moves the Servo to the new position. More...
 
void storePosition (int pos, int speed=0x3FF)
 This saves the Servo Position. More...
 
optVAL_t getPosition (void)
 This "kind of" returns the Servo-Position. More...
 
bool isMoving (void)
 Use this if you wan't to have a nice way of writing false. More...
 

Public Attributes

DynamixelBoard_conBoard
 
int storedPos
 stores the position the Servo should go to DynamixelBoard::action() More...
 
int storedSpe
 stores the Speed of the Servo DynamixelBoard::action() More...
 
optVAL_t id
 stores the id of the AX12Servo obejct More...
 

Private Attributes

int actPos
 stores the actual pos or move-to pos of the AX12Servo More...
 
int actSpe
 stores the actual 'would use speed' of the AX12Servo More...
 

Detailed Description

[COPY&PASTE] This is the AX12Servo ghost struct :D

Author
EagleoutIce

[COPY&PASTE] You can use this class like this:

#include <eBoard.h>
//manual: '#include "/path/to/eBoard.h"'
DynamixelBoard servoBoard(board);
AX12Servo Links(servoBoard,1);
AX12Servo Rechts(servoBoard,2);
int main() {
for(;;) {
Links.setPosition(500);
Rechts.setPosition(200);
}
}

Definition at line 3130 of file eBoard.h.

Constructor & Destructor Documentation

◆ AX12Servo() [1/2]

AX12Servo::AX12Servo ( void  )

The constructor.

Warning
This constructor shouldn't be called!

◆ AX12Servo() [2/2]

AX12Servo::AX12Servo ( DynamixelBoard dBoard,
optVAL_t  servoID 
)

The constructor.

Parameters
dBoardthis will be used to register new Servos
servoIDthe ID of the AX-12 Servo

Member Function Documentation

◆ changeMotorID()

void AX12Servo::changeMotorID ( optVAL_t  newID)
inline

change the hardwareID of this AX-12 Servo and will continue speaking to the new [reconnection recommended]

Parameters
newIDthe new ID of the Servo

this should change the hardwareID of the Servo... but we don't want to mess things up do we? \n if we want to: _servoHandler.SetID(this->id, newID);

◆ getPosition()

optVAL_t AX12Servo::getPosition ( void  )
inline

This "kind of" returns the Servo-Position.

Returns
The position the servo is (actually driving to)

Referenced by main().

+ Here is the caller graph for this function:

◆ isMoving()

bool AX12Servo::isMoving ( void  )
inline

Use this if you wan't to have a nice way of writing false.

Note
this doesnt talk to the servo
Returns
false

◆ ledOff()

void AX12Servo::ledOff ( void  )
inline

Noone needs the AX-12 Servo LED^^.

◆ ledOn()

void AX12Servo::ledOn ( void  )
inline

Noone needs the AX-12 Servo LED^^.

◆ setID()

void AX12Servo::setID ( optVAL_t  newID)
inline

change the AX-12 Servo this object should speak to

Parameters
newIDthe new ID of the Servo
Note
why should anyone need that?

◆ setPosition()

void AX12Servo::setPosition ( int  pos,
int  speed = 0x3FF 
)

This moves the Servo to the new position.

This will overwrite storedPos and storedSpeed!

Parameters
posthe Position the Servo should go to [0;1023 (w EBOARD_CLAMP)]
speedthe speed of the Servo

◆ setPositionMode()

void AX12Servo::setPositionMode ( void  )
inline

set the AX-12 Servo to positionMode

Note
as there is no rotationMode there is nothing this does

◆ setSpeed()

void AX12Servo::setSpeed ( optVAL_t  )
inline

๐Ÿ”ง I prevent errors!

Note
as there is no rotationMode there is nothing this does

◆ setSpeedMode()

void AX12Servo::setSpeedMode ( void  )
inline

set the AX-12 Servo NOT to speedMode

Note
as there is no rotationMode there is nothing this does

◆ setTorque()

void AX12Servo::setTorque ( uint16_t  )
inline

๐Ÿ”ง I prevent errors!

◆ storePosition()

void AX12Servo::storePosition ( int  pos,
int  speed = 0x3FF 
)
inline

This saves the Servo Position.

Sets the values used by DynamixelBoard::action()

Parameters
posthe Position the Servo should go to [0;1023 (w EBOARD_CLAMP)]
speedthe speed of the Servo

Referenced by main().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _conBoard

DynamixelBoard* AX12Servo::_conBoard

Definition at line 3144 of file eBoard.h.

◆ actPos

int AX12Servo::actPos
private

stores the actual pos or move-to pos of the AX12Servo

Definition at line 3238 of file eBoard.h.

◆ actSpe

int AX12Servo::actSpe
private

stores the actual 'would use speed' of the AX12Servo

Definition at line 3240 of file eBoard.h.

◆ id

optVAL_t AX12Servo::id

stores the id of the AX12Servo obejct

Definition at line 3235 of file eBoard.h.

◆ storedPos

int AX12Servo::storedPos

stores the position the Servo should go to DynamixelBoard::action()

Note
pls do me a favour and don't change them manually... use AX12Servo::storePosition()

Definition at line 3224 of file eBoard.h.

◆ storedSpe

int AX12Servo::storedSpe

stores the Speed of the Servo DynamixelBoard::action()

Note
pls do me a favour and don't change them manually... use AX12Servo::storePosition()

Definition at line 3230 of file eBoard.h.


The documentation for this struct was generated from the following file: