eBoard ①⑧⑨
Written for SIA 2017/2018
AX12Servo Struct Reference

This is the AX12Servo ghost struct :D. More...

#include <eagle_AX12Servo.h>

+ Collaboration diagram for AX12Servo:

Public Member Functions

 AX12Servo (void)
 The constructor. More...
 
 AX12Servo (DynamixelBoard &dBoard, optVAL_t servoID)
 The constructor. 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

This is the AX12Servo ghost struct :D.

Author
EagleoutIce

You can use this class like this: You can use this class like this: You can use this class like this: 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 54 of file eagle_AX12Servo.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

◆ 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

◆ 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

◆ 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 68 of file eagle_AX12Servo.h.

◆ actPos

int AX12Servo::actPos
private

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

Definition at line 162 of file eagle_AX12Servo.h.

◆ actSpe

int AX12Servo::actSpe
private

stores the actual 'would use speed' of the AX12Servo

Definition at line 164 of file eagle_AX12Servo.h.

◆ id

optVAL_t AX12Servo::id

stores the id of the AX12Servo obejct

Definition at line 159 of file eagle_AX12Servo.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 148 of file eagle_AX12Servo.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 154 of file eagle_AX12Servo.h.


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