#include <CDxlGroup.h>
Public Member Functions | |
int | addNewDynamixel (CDxlConfig *config) |
CDxlGroup () | |
virtual bool | deinit () |
int | enableTorqueAll (int state) |
CDxlGeneric * | getDynamixel (const int index) |
std::string & | getName () |
int | getNumDynamixels () |
int | getPosAll () |
int | getPosAndSpeedAll () |
int | getPosSpeedTorqueAll () |
int | getStateAll () |
int | getStatusAll () |
int | getTempAll () |
virtual bool | init () |
int | sendSyncWritePacket () |
int | setConfig (CDxlGroupConfig *config) |
int | setEndlessTurnModeAll (bool enabled) |
void | setName (const std::string &name) |
void | setSerialPort (LxSerial *serialport) |
void | setSyncWriteType (const BYTE instruction=INST_SYNC_WRITE) |
int | setupSyncReadChain () |
int | syncRead (int startingAddress, int dataLength) |
int | writeData (int ID, int startingAddress, int dataLength, BYTE *data) |
virtual | ~CDxlGroup () |
Protected Member Functions | |
int | action () |
int | initAll () |
Protected Attributes | |
CDxlGeneric * | mDynamixels [MAX_NUM_DYNAMIXELS] |
CLog2 | mLog |
std::string | mName |
int | mNumDynamixels |
CDxlStatusPacket * | mStatusPackets [MAX_NUM_DYNAMIXELS] |
CDxlSyncWritePacket * | mSyncPacket |
bool | mSyncRead |
Definition at line 21 of file CDxlGroup.h.
Definition at line 16 of file CDxlGroup.cpp.
CDxlGroup::~CDxlGroup | ( | ) | [virtual] |
Definition at line 26 of file CDxlGroup.cpp.
int CDxlGroup::action | ( | ) | [protected] |
Definition at line 82 of file CDxlGroup.cpp.
int CDxlGroup::addNewDynamixel | ( | CDxlConfig * | config | ) |
Definition at line 89 of file CDxlGroup.cpp.
bool CDxlGroup::deinit | ( | ) | [virtual] |
Definition at line 62 of file CDxlGroup.cpp.
int CDxlGroup::enableTorqueAll | ( | int | state | ) |
Definition at line 376 of file CDxlGroup.cpp.
CDxlGeneric * CDxlGroup::getDynamixel | ( | const int | index | ) |
Definition at line 398 of file CDxlGroup.cpp.
std::string & CDxlGroup::getName | ( | ) |
Definition at line 52 of file CDxlGroup.cpp.
int CDxlGroup::getNumDynamixels | ( | ) |
Definition at line 393 of file CDxlGroup.cpp.
int CDxlGroup::getPosAll | ( | ) |
Definition at line 290 of file CDxlGroup.cpp.
int CDxlGroup::getPosAndSpeedAll | ( | ) |
Definition at line 307 of file CDxlGroup.cpp.
int CDxlGroup::getPosSpeedTorqueAll | ( | ) |
Definition at line 325 of file CDxlGroup.cpp.
int CDxlGroup::getStateAll | ( | ) |
Definition at line 249 of file CDxlGroup.cpp.
int CDxlGroup::getStatusAll | ( | ) |
Definition at line 273 of file CDxlGroup.cpp.
int CDxlGroup::getTempAll | ( | ) |
Definition at line 342 of file CDxlGroup.cpp.
bool CDxlGroup::init | ( | ) | [virtual] |
Definition at line 57 of file CDxlGroup.cpp.
int CDxlGroup::initAll | ( | ) | [protected] |
Definition at line 226 of file CDxlGroup.cpp.
int CDxlGroup::sendSyncWritePacket | ( | ) |
Groups can write command to servo's in a group message. To do this the individual servo's write their data to a group packet with the writeData function below. With the sendSyncWrite function you can send the packet.
Documentation from Robotis RX28 about the syncwrite packect: This command is used to control several RX-28s simultaneously with one Instruction Function Packet transmission. When this command is used, several commands are transmitted at once, so that the communication time is reduced when multiple RX-28s are controlled. However, the SYNC WRITE command can be used only if both of the address and length of the Control Table to write is identical. Besides, ID should be transmitted as Broadcasting ID. Make sure that the length of packet does not to exceed 143 bytes since the volume of receiving buffer of RX-28 is 143 bytes.
This function sends the group packed that has been filled by the dynamixels/3mxls after sending it resets the group message
Definition at line 133 of file CDxlGroup.cpp.
int CDxlGroup::setConfig | ( | CDxlGroupConfig * | config | ) |
Definition at line 404 of file CDxlGroup.cpp.
int CDxlGroup::setEndlessTurnModeAll | ( | bool | enabled | ) |
Definition at line 359 of file CDxlGroup.cpp.
void CDxlGroup::setName | ( | const std::string & | name | ) |
Definition at line 47 of file CDxlGroup.cpp.
void CDxlGroup::setSerialPort | ( | LxSerial * | serialport | ) |
Definition at line 41 of file CDxlGroup.cpp.
void CDxlGroup::setSyncWriteType | ( | const BYTE | instruction = INST_SYNC_WRITE | ) |
enable group to set instruction type for syncwrite
Definition at line 221 of file CDxlGroup.cpp.
int CDxlGroup::setupSyncReadChain | ( | ) |
Definition at line 109 of file CDxlGroup.cpp.
int CDxlGroup::syncRead | ( | int | startingAddress, |
int | dataLength | ||
) |
Definition at line 185 of file CDxlGroup.cpp.
int CDxlGroup::writeData | ( | int | ID, |
int | startingAddress, | ||
int | dataLength, | ||
BYTE * | data | ||
) |
This function is used by the CDxlGeneric type classes to write their data to a Group packet in stead of directly to the serial port. If the Servo was added to a group it will have been given a pointer to this group so it can write its data to the group. You can then send the group packet with sendSyncWritePacket().
Definition at line 161 of file CDxlGroup.cpp.
CDxlGeneric* CDxlGroup::mDynamixels[MAX_NUM_DYNAMIXELS] [protected] |
Definition at line 25 of file CDxlGroup.h.
CLog2 CDxlGroup::mLog [protected] |
Reimplemented from CDxlCom.
Definition at line 30 of file CDxlGroup.h.
std::string CDxlGroup::mName [protected] |
Definition at line 24 of file CDxlGroup.h.
int CDxlGroup::mNumDynamixels [protected] |
Definition at line 26 of file CDxlGroup.h.
CDxlStatusPacket* CDxlGroup::mStatusPackets[MAX_NUM_DYNAMIXELS] [protected] |
Definition at line 32 of file CDxlGroup.h.
CDxlSyncWritePacket* CDxlGroup::mSyncPacket [protected] |
Definition at line 27 of file CDxlGroup.h.
bool CDxlGroup::mSyncRead [protected] |
Definition at line 31 of file CDxlGroup.h.