![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
Dynamixel Chain Container Base Class. More...
#include <DynaChain.h>
Public Member Functions | |
DynaChain (DynaComm &comm) | |
Default initialization constructor. More... | |
virtual | ~DynaChain () |
Destructor. | |
virtual bool | HasServo (int nServoId) const |
virtual DynaServo * | GetServo (int nServoId) |
virtual uint_t | GetNumberInChain () const |
Get the number of servos currently in chain. More... | |
virtual int | LinkServos (int nServoIdMaster, int nServoIdSlave, bool bIsReversed) |
Software link two unlinked servos in a master-slave configuration. More... | |
virtual int | UnlinkServos (int nServoIdMaster) |
Unlink two software linked servos. More... | |
virtual bool | IsMaster (int nServoId) const |
Test if the servo is a master. More... | |
bool | IsLinkedMaster (int nServoId) const |
Test if this servo is a linked master. More... | |
bool | IsLinkedSlave (int nServoId) const |
Test if this servo is a linked slave. More... | |
bool | IsUnlinked (int nServoId) const |
Test if this servo is unlinked. More... | |
int | GetLinkedMateId (int nServoId) const |
Get linked mate. More... | |
virtual uint_t | GetNumberOfMastersInChain () |
Get the number of servos currently in chain. More... | |
virtual int | AddNewServo (int nServoId) |
Create a new servo and add it to the Dynamixel chain. More... | |
virtual int | AddNewServosByScan () |
Scan and add all discovered and created servos to the Dynamixel chain. More... | |
virtual int | AddNewServoForced (int nServoId, uint_t uModelNum) |
Force create and add a servo to the Dynamixel chain. More... | |
virtual int | RemoveServo (int nServoId) |
Remove from chain and delete. More... | |
virtual int | RemoveAllServos () |
Remove all servos from chain and delete. More... | |
virtual int | MoveTo (int nServoId, int nGoalOdPos) |
Move to the goal postition. More... | |
virtual int | vSyncMoveTo (uint_t uCount,...) |
Synchronous move servos to new goal positions. More... | |
virtual int | SyncMoveTo (DynaPosTuple_T tuplesPos[], uint_t uCount) |
Synchronous move servos to new goal positions in tuple list. More... | |
virtual int | MoveAtSpeedTo (int nServoId, int nGoalSpeed, int nGoalOdPos) |
Move at speed to the goal postition. More... | |
virtual int | vSyncMoveAtSpeedTo (uint_t uCount,...) |
Synchronous move servos to new goal positions at the given speeds. More... | |
virtual int | SyncMoveAtSpeedTo (DynaSpeedPosTuple_T tuplesSpeedPos[], uint_t uCount) |
Synchronous move servos to new goal positions at the given speeds. More... | |
virtual int | MoveAtSpeed (int nServoId, int nGoalSpeed) |
Move at speed. More... | |
virtual int | vSyncMoveAtSpeed (uint_t uCount,...) |
Synchronous move servos at the given speeds. More... | |
virtual int | SyncMoveAtSpeed (DynaSpeedTuple_T tuplesSpeed[], uint_t uCount) |
Synchronous move servos at the given speeds. More... | |
virtual int | EStop () |
Emergency stop all servos. More... | |
virtual int | Stop () |
Stop all servos. More... | |
virtual int | Freeze () |
Freeze all servos at current position. More... | |
virtual int | Release () |
Release all servos from any applied torque. More... | |
virtual int | SyncWriteTorqueEnable (bool bState) |
Synchronous write to all of the servos in the chain to enable/disable applied torque. More... | |
virtual int | vSyncWriteGoalPos (uint_t uCount,...) |
Synchronous write new goal positions for servos. More... | |
virtual int | SyncWriteGoalPos (DynaPosTuple_T tuplesPos[], uint_t uCount) |
Synchronous write new goal positions for servos. More... | |
virtual int | vSyncWriteGoalSpeed (uint_t uCount,...) |
Synchronous write new goal speed for for servos. More... | |
virtual int | SyncWriteGoalSpeed (DynaSpeedTuple_T tuplesSpeed[], uint_t uCount) |
Synchronous write new goal speed for servos. More... | |
virtual int | IterStart (int *pIter) |
Start iteration over of entire servo chain. More... | |
virtual int | IterNext (int *pIter) |
Next iteration over of entire servo chain. More... | |
virtual int | IterStartMaster (int *pIter) |
Start iteration master servos over of entire servo chain. More... | |
virtual int | IterNextMaster (int *pIter) |
Next iteration of master servos over of entire servo chain. More... | |
const DynaServo * | operator[] (int nServoId) |
Subscript operator. More... | |
Protected Member Functions | |
void | Init () |
Initialize chain class instance. | |
virtual int | ChainEntryNew (int nServoId) |
Create new dervied DyanServo object and insert into chain. More... | |
virtual int | ChainEntryDelete (int nServoId) |
Remove servo from chain and delete. More... | |
virtual void | AuditLinks () |
Audit servo links and repair or delete. More... | |
virtual void | SetLinkData (int nServoId, uint_t uLinkType, int nServoIdMate, bool bRotReversed) |
Set local link data for the given servo. More... | |
virtual void | ClearLinkData (int nServoId) |
Clear local link data for the given servo. | |
Protected Attributes | |
DynaComm & | m_comm |
bus communication instance | |
DynaServo * | m_pChain [DYNA_ID_NUMOF] |
chain of servos | |
int | m_nIIdx [DYNA_ID_NUMOF] |
indirect index | |
DynaServoLink_T | m_links [DYNA_ID_NUMOF] |
servo linked info | |
uint_t | m_uNumInChain |
number of servos in chain | |
uint_t | m_uNumMastersInChain |
num of master servos in chain | |
Dynamixel Chain Container Base Class.
The DynaChain base class provides a coherent and synchronized interface to a set of servos communicating on the same Dynamixel bus.
Definition at line 75 of file DynaChain.h.
DynaChain::DynaChain | ( | DynaComm & | comm | ) |
Default initialization constructor.
The chain is bound to the given Dynamixel bus communication object. No servos are present in the chain until explicitly added.
A background thread may be automatically started (default) to:
It is recommended that if any of the servos in the chain are in continuous (wheel) mode and have 360 ° positioning data, that the background thread be started.
comm | Dynamixel bus communication instance. |
Definition at line 82 of file DynaChain.cxx.
References Init().
|
virtual |
Create a new servo and add it to the Dynamixel chain.
Communication with servo is checked prior to adding the servo.
nServoId | Servo id to add. |
Definition at line 206 of file DynaChain.cxx.
References AuditLinks(), ChainEntryNew(), DYNA_ECODE_NO_SERVO, DYNA_LOG_ERROR, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and m_comm.
Referenced by GetLinkedMateId().
|
virtual |
Force create and add a servo to the Dynamixel chain.
No communication with servo is attempted, nor any data validation performed.
nServoId | Servo id to add. |
uModelNum | Servo model number. |
Definition at line 259 of file DynaChain.cxx.
References DYNA_ECODE_NOT_SUPP.
Referenced by GetLinkedMateId().
|
virtual |
Scan and add all discovered and created servos to the Dynamixel chain.
Definition at line 229 of file DynaChain.cxx.
References AuditLinks(), ChainEntryDelete(), ChainEntryNew(), DYNA_ID_MIN, DYNA_ID_NUMOF, DYNA_OK, DYNA_TRY_COMM, and m_comm.
Referenced by DynaShellCmdScan::Exec(), and GetLinkedMateId().
|
protectedvirtual |
Audit servo links and repair or delete.
Definition at line 388 of file DynaChain.cxx.
References ClearLinkData(), DYNA_ID_MAX, DYNA_ID_MIN, DYNA_ID_NUMOF, DYNA_LINK_MASTER, DYNA_LINK_SLAVE, DynaServo::GetModelNumber(), GetNumberOfMastersInChain(), DynaServo::Link(), DynaServoLink_T::m_bRotReversed, m_links, DynaServoLink_T::m_nServoIdMate, m_pChain, DynaServoLink_T::m_uLinkType, SetLinkData(), and DynaServo::Unlink().
Referenced by AddNewServo(), AddNewServosByScan(), RemoveAllServos(), and RemoveServo().
|
protectedvirtual |
Remove servo from chain and delete.
nServoId | Servo Id to delete. |
Definition at line 346 of file DynaChain.cxx.
References DYNA_ID_NONE, DYNA_OK, DYNA_TRY_SERVO_ID, DynaServo::GetModelName(), DynaServo::GetModelNumber(), m_nIIdx, m_pChain, and m_uNumInChain.
Referenced by AddNewServosByScan(), ChainEntryNew(), RemoveAllServos(), and RemoveServo().
|
protectedvirtual |
Create new dervied DyanServo object and insert into chain.
nServoId | Servo Id to delete. |
Definition at line 312 of file DynaChain.cxx.
References ChainEntryDelete(), DYNA_ECODE_NO_SERVO, DYNA_LOG_ERROR, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, DynaServo::GetModelName(), DynaServo::GetModelNumber(), m_comm, m_nIIdx, m_pChain, m_uNumInChain, and DynaServo::New().
Referenced by AddNewServo(), and AddNewServosByScan().
|
virtual |
Emergency stop all servos.
All torque is removed.
Definition at line 714 of file DynaChain.cxx.
References DYNA_OK, DYNA_TRY_COMM, m_comm, and SyncWriteTorqueEnable().
Referenced by DynaShellCmdEStop::Exec(), and GetLinkedMateId().
|
virtual |
Freeze all servos at current position.
Torque is applied.
Definition at line 751 of file DynaChain.cxx.
References DYNA_OK, DYNA_TRY_COMM, m_comm, Stop(), and SyncWriteTorqueEnable().
Referenced by DynaShellCmdFreeze::Exec(), GetLinkedMateId(), and DynaShellCmdPlay::SecureArm().
|
inline |
Get linked mate.
nServoId | Servo id. |
Definition at line 238 of file DynaChain.h.
References AddNewServo(), AddNewServoForced(), AddNewServosByScan(), DYNA_ID_MAX, DYNA_ID_MIN, DYNA_ID_NONE, EStop(), Freeze(), GetNumberOfMastersInChain(), IterNext(), IterNextMaster(), IterStart(), IterStartMaster(), m_links, DynaServoLink_T::m_nServoIdMate, MoveAtSpeed(), MoveAtSpeedTo(), MoveTo(), operator[](), Release(), RemoveAllServos(), RemoveServo(), Stop(), SyncMoveAtSpeed(), SyncMoveAtSpeedTo(), SyncMoveTo(), SyncWriteGoalPos(), SyncWriteGoalSpeed(), SyncWriteTorqueEnable(), vSyncMoveAtSpeed(), vSyncMoveAtSpeedTo(), vSyncMoveTo(), vSyncWriteGoalPos(), and vSyncWriteGoalSpeed().
Referenced by DynaShellCmdList::Exec().
|
inlinevirtual |
Get the number of servos currently in chain.
Definition at line 140 of file DynaChain.h.
References LinkServos(), m_uNumInChain, and UnlinkServos().
Referenced by DynaShellCmd::ChkChainNotEmpty(), DynaShellCmdScan::Exec(), DynaBgThread::RegisterChainAgent(), DynaShellCmdSetPid::TabCompletion(), DynaShellCmdChainIn::TabCompletion(), DynaShellCmdLink::TabCompletion(), DynaShellCmdChainOut::TabCompletion(), DynaShellCmdUnlink::TabCompletion(), DynaShellCmdBgtStart::TabCompletion(), DynaShellCmdReadMaxTorqueLimit::TabCompletion(), DynaShellCmdWriteMaxTorqueLimit::TabCompletion(), DynaShellCmdReadByte::TabCompletion(), DynaShellCmdWriteByte::TabCompletion(), and DynaShellCmdPlay::WaitStop().
|
virtual |
Get the number of servos currently in chain.
Definition at line 182 of file DynaChain.cxx.
References DYNA_ID_NONE, IsMaster(), m_nIIdx, m_uNumInChain, and m_uNumMastersInChain.
Referenced by AuditLinks(), DynaShellCmdPlay::Exec(), GetLinkedMateId(), LinkServos(), DynaShellCmdChainIn::TabCompletion(), DynaShellCmdChainOut::TabCompletion(), and UnlinkServos().
|
inlinevirtual |
Get the servo in the chain
nServoId | Servo id. |
Definition at line 129 of file DynaChain.h.
References DYNA_ID_MAX, DYNA_ID_MIN, and m_pChain.
Referenced by DynaShellCmd::ChkChainIsMasterServo(), DynaShellCmdPlay::ControlToGoals(), DynaShellCmdCfgWriteServoMode::doExec(), DynaShellCmdWriteTorqueEnable::doExec(), DynaShellCmdWriteGoalSpeed::doExec(), DynaShellCmdSetPid::Exec(), DynaShellCmdList::Exec(), DynaShellCmdChainIn::Exec(), DynaShellCmdSetOdometer::Exec(), DynaShellCmdTrain::Exec(), DynaShellCmdPlay::Exec(), DynaShellCmdSetSoftTorqueTh::Exec(), DynaShellCmdPlay::PidInit(), DynaShellCmdPlay::PidSetPoint(), DynaShellCmdPlay::PlotWriteData(), DynaShellCmdTrain::RecordTraining(), and DynaShellCmdPlay::WaitStop().
|
inlinevirtual |
Test if servo is in the chain.
nServoId | Servo id. |
Definition at line 113 of file DynaChain.h.
References DYNA_ID_MAX, DYNA_ID_MIN, and m_pChain.
Referenced by DynaShellCmd::ChkChainHasServo().
|
inline |
Test if this servo is a linked master.
A linked master is the master servo in a linked master-slave configuration.
nServoId | Servo id. |
Definition at line 196 of file DynaChain.h.
References DYNA_ID_MAX, DYNA_ID_MIN, DYNA_LINK_MASTER, and m_links.
Referenced by DynaShellCmdList::Exec(), and DynaShellCmdUnlink::TabCompletion().
|
inline |
Test if this servo is a linked slave.
A linked slave is the slave servo in a linked master-slave configuration.
nServoId | Servo id. |
Definition at line 211 of file DynaChain.h.
References DYNA_ID_MAX, DYNA_ID_MIN, DYNA_LINK_SLAVE, and m_links.
Referenced by DynaShellCmdList::Exec().
|
inlinevirtual |
Test if the servo is a master.
A master is either the master servo in a linked master-slave configuration, or an unlinked servo (a master unto thyself).
nServoId | Servo id. |
Definition at line 180 of file DynaChain.h.
References DYNA_ID_MAX, DYNA_ID_MIN, DYNA_LINK_MASTER, DYNA_LINK_NONE, and m_links.
Referenced by GetNumberOfMastersInChain(), IterNextMaster(), and IterStartMaster().
|
inline |
Test if this servo is unlinked.
nServoId | Servo id. |
Definition at line 224 of file DynaChain.h.
References DYNA_ID_MAX, DYNA_ID_MIN, DYNA_LINK_NONE, and m_links.
Referenced by DynaShellCmdLink::TabCompletion().
|
virtual |
Next iteration over of entire servo chain.
pIter | Pointer to iterator. |
Definition at line 1020 of file DynaChain.cxx.
References DYNA_ID_NONE, m_nIIdx, and m_uNumInChain.
Referenced by DynaShellCmdSetPid::Exec(), DynaShellCmdList::Exec(), DynaShellCmdChainIn::Exec(), DynaShellCmdChainOut::Exec(), DynaShellCmdReadMaxTorqueLimit::Exec(), DynaShellCmdWriteMaxTorqueLimit::Exec(), DynaShellCmdReadByte::Exec(), DynaShellCmdWriteByte::Exec(), GetLinkedMateId(), SyncWriteTorqueEnable(), DynaShellCmdSetPid::TabCompletion(), DynaShellCmdChainIn::TabCompletion(), DynaShellCmdLink::TabCompletion(), DynaShellCmdChainOut::TabCompletion(), DynaShellCmdReadMaxTorqueLimit::TabCompletion(), DynaShellCmdWriteMaxTorqueLimit::TabCompletion(), DynaShellCmdReadByte::TabCompletion(), DynaShellCmdWriteByte::TabCompletion(), and DynaShellCmdPlay::WaitStop().
|
virtual |
Next iteration of master servos over of entire servo chain.
pIter | Pointer to iterator. |
Definition at line 1058 of file DynaChain.cxx.
References DYNA_ID_NONE, IsMaster(), m_nIIdx, m_pChain, and m_uNumInChain.
Referenced by DynaShellCmdMoveAtSpeedTo::Exec(), DynaShellCmdChainIn::Exec(), DynaShellCmdChainOut::Exec(), DynaShellCmdTrain::Exec(), DynaShellCmdPlay::Exec(), GetLinkedMateId(), DynaShellCmdPlay::PidInit(), DynaShellCmdTrain::RecordTraining(), Stop(), DynaShellCmdChainIn::TabCompletion(), DynaShellCmdChainOut::TabCompletion(), and DynaShellCmdUnlink::TabCompletion().
|
virtual |
Start iteration over of entire servo chain.
pIter | Pointer to iterator. |
Definition at line 1008 of file DynaChain.cxx.
References DYNA_ID_NONE, m_nIIdx, and m_uNumInChain.
Referenced by DynaShellCmdSetPid::Exec(), DynaShellCmdList::Exec(), DynaShellCmdChainIn::Exec(), DynaShellCmdChainOut::Exec(), DynaShellCmdReadMaxTorqueLimit::Exec(), DynaShellCmdWriteMaxTorqueLimit::Exec(), DynaShellCmdReadByte::Exec(), DynaShellCmdWriteByte::Exec(), GetLinkedMateId(), SyncWriteTorqueEnable(), DynaShellCmdSetPid::TabCompletion(), DynaShellCmdChainIn::TabCompletion(), DynaShellCmdLink::TabCompletion(), DynaShellCmdChainOut::TabCompletion(), DynaShellCmdReadMaxTorqueLimit::TabCompletion(), DynaShellCmdWriteMaxTorqueLimit::TabCompletion(), DynaShellCmdReadByte::TabCompletion(), DynaShellCmdWriteByte::TabCompletion(), and DynaShellCmdPlay::WaitStop().
|
virtual |
Start iteration master servos over of entire servo chain.
pIter | Pointer to iterator. |
Definition at line 1036 of file DynaChain.cxx.
References DYNA_ID_NONE, IsMaster(), m_nIIdx, m_pChain, and m_uNumInChain.
Referenced by DynaShellCmdMoveAtSpeedTo::Exec(), DynaShellCmdChainIn::Exec(), DynaShellCmdChainOut::Exec(), DynaShellCmdTrain::Exec(), DynaShellCmdPlay::Exec(), GetLinkedMateId(), DynaShellCmdPlay::PidInit(), DynaShellCmdTrain::RecordTraining(), Stop(), DynaShellCmdChainIn::TabCompletion(), DynaShellCmdChainOut::TabCompletion(), and DynaShellCmdUnlink::TabCompletion().
|
virtual |
Software link two unlinked servos in a master-slave configuration.
The servos must be of the same Dynamixel model number.
nServoIdMaster | Master servo id. |
nServoIdSlave | Slave servo id. |
bRotReversed | The linked servos do [not] rotate in opposite directions. |
Definition at line 105 of file DynaChain.cxx.
References DYNA_ECODE_LINKED, DYNA_LINK_MASTER, DYNA_LINK_NONE, DYNA_LINK_SLAVE, DYNA_LOG_ERROR, DYNA_OK, DYNA_TRY_EXPR, DYNA_TRY_SERVO_IN_CHAIN, DynaServo::GetModelName(), DynaServo::GetModelNumber(), GetNumberOfMastersInChain(), DynaServo::Link(), m_links, m_pChain, and SetLinkData().
Referenced by DynaShellCmdLink::Exec(), and GetNumberInChain().
|
virtual |
Move at speed.
Speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify rotation in the clockwise direction, stop, or rotation in the counterclockwise direction, respectively.
For servos in servo mode, the goal direction is not applicable, and therefore, the speeds are in the range [0,max]. The special value 0 is equivalent to the maximum rpm speed without servo speed control.
If this servo is the master in a linked pair of servos, both servos will move synchronously.
nServoId | Servo Id |
nGoalSpeed | Goal speed. |
Definition at line 655 of file DynaChain.cxx.
References DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_IN_CHAIN, m_comm, and m_pChain.
Referenced by GetLinkedMateId().
|
virtual |
Move at speed to the goal postition.
For servos in continuous mode, speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify rotation in the clockwise direction, stop, or rotation in the counterclockwise direction, respectively.
For servos in servo mode, the goal direction is not applicable, and therefore, the speeds are in the range [0,max]. The special value 0 is equivalent to the maximum rpm speed without servo speed control.
If the servo is in continuous mode, but supports 360 ° positioning data, then a registered external user control function is required.
If this servo is the master in a linked pair of servos, both servos will move synchronously.
nServoId | Servo Id |
uGoalSpeed | Goal speed (raw). |
uGoalOdPos | Goal position (odometer ticks). |
Definition at line 559 of file DynaChain.cxx.
References DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_POS_CTL, DYNA_TRY_SERVO_IN_CHAIN, m_comm, and m_pChain.
Referenced by DynaShellCmdMoveAtSpeedTo::doExec(), and GetLinkedMateId().
|
virtual |
Move to the goal postition.
The move will proceed at the current goal speed. If the servo is in continuous mode, but supports 360 ° positioning data, then a registered external user control function is required.
If this servo is the master in a linked pair of servos, both servos will move synchronously.
nServoId | Servo Id |
uGoalOdPos | Goal positon (odometer ticks). |
Definition at line 480 of file DynaChain.cxx.
References DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_IN_CHAIN, m_comm, and m_pChain.
Referenced by DynaShellCmdMoveTo::doExec(), and GetLinkedMateId().
const DynaServo * DynaChain::operator[] | ( | int | nServoId | ) |
Subscript operator.
nServoId | Servo id. |
Definition at line 1085 of file DynaChain.cxx.
References DYNA_ID_MAX, DYNA_ID_MIN, and m_pChain.
Referenced by GetLinkedMateId().
|
virtual |
Release all servos from any applied torque.
Servos are free to rotate.
Definition at line 770 of file DynaChain.cxx.
References DYNA_TRY_COMM, m_comm, and SyncWriteTorqueEnable().
Referenced by DynaShellCmdRelease::Exec(), and GetLinkedMateId().
|
virtual |
Remove all servos from chain and delete.
Definition at line 275 of file DynaChain.cxx.
References AuditLinks(), ChainEntryDelete(), DYNA_ID_MIN, DYNA_ID_NUMOF, DYNA_OK, and m_pChain.
Referenced by GetLinkedMateId().
|
virtual |
Remove from chain and delete.
nServoId | Servo Id to delete. |
Definition at line 265 of file DynaChain.cxx.
References AuditLinks(), ChainEntryDelete(), DYNA_OK, and DYNA_TRY_SERVO_IN_CHAIN.
Referenced by GetLinkedMateId().
|
protectedvirtual |
Set local link data for the given servo.
nServiId | Servo id. |
uLinkType | This servo's link type. |
nServoIdMate | Mate servo id. |
bRotReversed | The linked servos do [not] rotate in opposite directions. |
Definition at line 458 of file DynaChain.cxx.
References DynaServoLink_T::m_bRotReversed, m_links, DynaServoLink_T::m_nServoIdMate, and DynaServoLink_T::m_uLinkType.
Referenced by AuditLinks(), and LinkServos().
|
virtual |
Stop all servos.
Current torque settings are kept.
Definition at line 733 of file DynaChain.cxx.
References DYNA_ID_NONE, DYNA_TRY_COMM, IterNextMaster(), IterStartMaster(), m_comm, and m_pChain.
Referenced by Freeze(), and GetLinkedMateId().
|
virtual |
Synchronous move servos at the given speeds.
If any servo is a linked master, the linked pair will moved synchronously at the appropriate speeds and directions.
tuplesSpeed | Array of servo id, goal speed 2-tuples. |
uCount | Number of tuples. |
Definition at line 695 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_MODE_CONTINUOUS, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_IN_CHAIN, DYNA_TRY_SERVO_IN_MODE, m_comm, m_pChain, and SyncWriteGoalSpeed().
Referenced by GetLinkedMateId().
|
virtual |
Synchronous move servos to new goal positions at the given speeds.
If any servo is a linked master, the linked pair will moved synchronously to the appropriate end positions at the appropriate speeds.
tuplesSpeedPos | Array of servo id, goal speed, and goal odometer position 3-tuples. |
Definition at line 596 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_POS_CTL, DYNA_TRY_SERVO_IN_CHAIN, DynaServo::HasAgent(), m_comm, DynaPosTuple_T::m_nPos, DynaPosTuple_T::m_nServoId, DynaSpeedTuple_T::m_nServoId, DynaSpeedPosTuple_T::m_nServoId, DynaSpeedTuple_T::m_nSpeed, m_pChain, SyncWriteGoalPos(), and SyncWriteGoalSpeed().
Referenced by DynaShellCmdMoveAtSpeedTo::doExec(), GetLinkedMateId(), and vSyncMoveAtSpeedTo().
|
virtual |
Synchronous move servos to new goal positions in tuple list.
If any servo is a linked master, the linked pair will moved synchronously to the appropriate end positions.
The moves will proceed at the current goal speeds.
tuplesPos | Array of servo id, goal odometer position tuples. |
uCount | Number of tuples. |
Definition at line 513 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_MODE_CONTINUOUS, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_POS_CTL, DYNA_TRY_SERVO_IN_CHAIN, DynaServo::GetServoMode(), m_comm, DynaPosTuple_T::m_nPos, DynaPosTuple_T::m_nServoId, m_pChain, and SyncWriteGoalPos().
Referenced by DynaShellCmdMoveTo::doExec(), GetLinkedMateId(), DynaShellCmdPlay::SetRecordGoals(), and vSyncMoveTo().
|
virtual |
Synchronous write new goal positions for servos.
If any servo is a linked master, the linked pair will moved synchronously to the appropriate end positions.
tuplesPos | Array of servo id, goal odometer position tuples. |
uCount | Number of tuples. |
Definition at line 837 of file DynaChain.cxx.
References DYNA_ADDR_GOAL_POS_LSB, DYNA_ECODE_BAD_VAL, DYNA_ID_NUMOF, DYNA_LINK_MASTER, DYNA_MODE_SERVO, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DYNA_TRY_RC, DYNA_TRY_SERVO_IN_CHAIN, DynaServo::GetServoId(), DynaServo::GetServoMode(), m_comm, m_links, DynaPosTuple_T::m_nPos, DynaSyncWriteTuple_T::m_nServoId, DynaPosTuple_T::m_nServoId, DynaServoLink_T::m_nServoIdMate, m_pChain, DynaServo::m_spec, DynaServo::m_state, DynaServoState_T::m_uGoalPos, DynaServoSpec_T::m_uRawPosMin, DynaSyncWriteTuple_T::m_uVal, DynaServo::OdometerToEncoder(), and DynaComm::SyncWrite().
Referenced by GetLinkedMateId(), SyncMoveAtSpeedTo(), SyncMoveTo(), and vSyncWriteGoalPos().
|
virtual |
Synchronous write new goal speed for servos.
If a servo is in continuous mode, rotation will occur indefinitely in the direction specified and at the given speed.
If the servo is in servo mode, rotation will occur until the goal position is achieved.
If any servo is a linked master, the linked pair will moved synchronously at the appropriate speeds and directions.
tuplesSpeed | Array of servo id,speed 2-tuples. |
uCount | Number of tuples. |
Definition at line 940 of file DynaChain.cxx.
References DYNA_ADDR_GOAL_SPEED_LSB, DYNA_ECODE_BAD_VAL, DYNA_ID_NUMOF, DYNA_LINK_MASTER, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_IN_CHAIN, DynaServo::GetServoId(), iabs(), m_comm, m_links, DynaServoState_T::m_nGoalSpeed, DynaSyncWriteTuple_T::m_nServoId, DynaSpeedTuple_T::m_nServoId, DynaServoLink_T::m_nServoIdMate, DynaSpeedTuple_T::m_nSpeed, m_pChain, DynaServo::m_spec, DynaServo::m_state, DynaServoSpec_T::m_uRawSpeedMax, DynaSyncWriteTuple_T::m_uVal, and DynaComm::SyncWrite().
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShellCmdWriteGoalSpeed::doExec(), GetLinkedMateId(), SyncMoveAtSpeed(), SyncMoveAtSpeedTo(), vSyncMoveAtSpeed(), and vSyncWriteGoalSpeed().
|
virtual |
Synchronous write to all of the servos in the chain to enable/disable applied torque.
If the torque state is false (off), no power is applied to the servo, allowing it to be free rotated by any external force.
bState | Torque enabled (true) or disabled (off) state. |
Definition at line 782 of file DynaChain.cxx.
References DYNA_ADDR_TORQUE_EN, DYNA_ID_NONE, DYNA_ID_NUMOF, DYNA_OK, DYNA_TORQUE_EN_OFF, DYNA_TORQUE_EN_ON, DYNA_TRY_COMM, IterNext(), IterStart(), DynaServoState_T::m_bTorqueEnabled, m_comm, DynaSyncWriteTuple_T::m_nServoId, m_pChain, DynaServo::m_state, DynaSyncWriteTuple_T::m_uVal, and DynaComm::SyncWrite().
Referenced by EStop(), Freeze(), GetLinkedMateId(), and Release().
|
virtual |
Unlink two software linked servos.
nServoIdMaster | Master servo id. |
Definition at line 146 of file DynaChain.cxx.
References ClearLinkData(), DYNA_ECODE_LINKED, DYNA_LINK_NONE, DYNA_OK, DYNA_TRY_EXPR, DYNA_TRY_SERVO_IN_CHAIN, GetNumberOfMastersInChain(), m_links, DynaServoLink_T::m_nServoIdMate, m_pChain, and DynaServo::Unlink().
Referenced by DynaShellCmdUnlink::Exec(), and GetNumberInChain().
|
virtual |
Synchronous move servos at the given speeds.
If any servo is a linked master, the linked pair will moved synchronously at the appropriate speeds and directions.
uCount | Number of tuples. |
... | A variable argument list of uCount 2-tuples of type (int,int) specifying the servo id and goal speed. |
Definition at line 669 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_MODE_CONTINUOUS, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_IN_CHAIN, DYNA_TRY_SERVO_IN_MODE, m_comm, DynaSpeedTuple_T::m_nServoId, DynaSpeedTuple_T::m_nSpeed, m_pChain, and SyncWriteGoalSpeed().
Referenced by GetLinkedMateId().
|
virtual |
Synchronous move servos to new goal positions at the given speeds.
If any servo is a linked master, the linked pair will moved synchronously to the appropriate end positions at the appropriate speeds.
uCount | Number of tuples. |
... | A variable argument list of uCount 3-tuples of type (int,int,int) specifying the servo id, goal speed, and the end goal odometer position. |
Definition at line 574 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_TRY_COMM, m_comm, DynaSpeedPosTuple_T::m_nPos, DynaSpeedPosTuple_T::m_nServoId, DynaSpeedPosTuple_T::m_nSpeed, and SyncMoveAtSpeedTo().
Referenced by GetLinkedMateId().
|
virtual |
Synchronous move servos to new goal positions.
If any servo is a linked master, the linked pair will moved synchronously to the appropriate end positions.
The moves will proceed at the current goal speeds.
uCount | Number of tuples. |
... | A variable argument list of uCount 2-tuples of type (int,int) specifying the servo id and the goal end position (odometer ticks). |
Definition at line 494 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DynaPosTuple_T::m_nPos, DynaPosTuple_T::m_nServoId, and SyncMoveTo().
Referenced by GetLinkedMateId().
|
virtual |
Synchronous write new goal positions for servos.
If any servo is a linked master, the linked pair will moved synchronously to the appropriate end positions.
uCount | Number of tuples. |
... | A variable argument list of uCount 2-tuples of type (int,int) specifying the servo id and the goal end position (odometer ticks). |
Definition at line 816 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_TRY_COMM, m_comm, DynaPosTuple_T::m_nPos, DynaPosTuple_T::m_nServoId, and SyncWriteGoalPos().
Referenced by GetLinkedMateId().
|
virtual |
Synchronous write new goal speed for for servos.
For servos in continuous mode, speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify rotation in the clockwise direction, stop, or rotation in the counterclockwise direction, respectively.
For servos in servo mode, the goal direction is not applicable, and therefore, the speeds are in the range [0,max]. The special value 0 is equivalent to the maximum rpm speed without servo speed control.
If any servo is a linked master, the linked pair will moved synchronously at the appropriate speeds and directions.
uCount | Number of tuples. |
... | A variable argument list of uCount 2-tuples of type (int,int) specifying the servo id and the goal speed. |
Definition at line 919 of file DynaChain.cxx.
References DYNA_ID_NUMOF, DYNA_TRY_COMM, m_comm, DynaSpeedTuple_T::m_nServoId, DynaSpeedTuple_T::m_nSpeed, and SyncWriteGoalSpeed().
Referenced by GetLinkedMateId().