![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
Dynamixel Servo Abstract Base Class. More...
#include <DynaServo.h>
Classes | |
struct | CrossLink_T |
Public Member Functions | |
DynaServo (DynaComm &comm, int nServoId, uint_t uModelNum, uint_t uFwVer) | |
Default initialization constructor. More... | |
virtual | ~DynaServo () |
Destructor. | |
virtual uint_t | GetModelNumber () const |
Get servo model number. More... | |
virtual uint_t | GetFirmwareVersion () const |
Get servo firmware version. More... | |
virtual const char * | GetModelName () const |
Get servo model name string. More... | |
virtual uint_t | GetServoId () const |
Get servo id. More... | |
virtual uint_t | GetServoMode () const |
Get the servo operational mode. More... | |
virtual uint_t | Has360PosInfo () const |
Test if servo has 360 ° positioning information. More... | |
virtual const DynaServoSpec_T & | GetSpecification () const |
Get servo specification. More... | |
virtual const DynaServoCfg_T & | GetConfiguration () const |
Get servo configuration. More... | |
virtual const DynaServoState_T & | GetState () const |
Get servo state. More... | |
bool | IsMaster () const |
Test if this servo is a master. More... | |
bool | IsLinkedMaster () const |
Test if this servo is a linked master. More... | |
bool | IsUnlinked () const |
Test if this servo is unlinked. More... | |
virtual const DynaServoLink_T | GetLinkInfo () const |
Get linked information. More... | |
virtual void | Link (uint_t uLinkType, DynaServo *pServoMate, bool bRotReversed) |
Link this servo to another. More... | |
virtual void | Unlink () |
Unlink this servo. | |
int | GetOdometer () |
Get the current virtual odometer value. More... | |
int | IsOdometerEnabled () |
Test if virtual odometer mapping is enabled. More... | |
int | GetOdometerZeroPt () |
Get the virtual odometer zero point. More... | |
bool | IsOdometerReversed () |
Test if the virtual odometer is reversed. More... | |
int | CalcOdometerAtEncMin () |
Calculate the odometer value at the minimum (zero) encoder value. More... | |
int | CalcOdometerAtEncMax () |
Calculate the odometer value at the maximum encoder value. More... | |
int | OdometerToEncoder (int nOdPos) |
Convert virtual odometer units to servo encoder units. More... | |
int | CalcSpeedDir (int nOdGoalPos) |
Calculate serve direction to goal odometer position. More... | |
virtual int | ResetOdometer (int nEncZeroPt, bool bIsReverse) |
Reset the servo's virtual odometer. More... | |
virtual int | UpdateOdometer (int nEncCurPos) |
Update the odometer from the current servo position and rotation direction. More... | |
virtual void | DisableOdometer () |
Disable odometer mapping. More... | |
virtual uint_t | GetAlarms () const |
Get the current servo alarms. More... | |
virtual uint_t | GetCurPos () const |
Get the current servo position. More... | |
virtual int | GetCurSpeed () const |
Get the current servo speed. More... | |
virtual int | GetGoalSpeed () const |
Get the goal servo speed. More... | |
virtual int | GetCurLoad () const |
Get the current servo load. More... | |
virtual uint_t | GetCurTemp () const |
Get the current temperature. More... | |
virtual float | CvtRawTempToC (uint uTemp)=0 |
Convert raw temperature coding to degrees Celsius. More... | |
virtual uint_t | GetCurVolt () const |
Get the current voltage. More... | |
virtual float | CvtRawVoltToVolts (uint uVolts)=0 |
Convert raw volts coding to volts. More... | |
virtual void | SetSoftTorqueThresholds (uint_t uOverTorqueTh, uint_t uClearTorqueTh) |
Set soft torque thresholds. More... | |
virtual void | GetSoftTorqueThresholds (uint_t &uOverTorqueTh, uint_t &uClearTorqueTh) |
Get soft torque thresholds. More... | |
virtual void | SetSoftTorqueOverCond (bool bNewCond) |
Set or clear servo in soft over torque condition. More... | |
virtual bool | HasSoftTorqueOverCond () |
Test if servo is in a soft over torque condition. More... | |
virtual void | RegisterAgent (DynaAgent_T *pAgent, void *pAgentArg) |
Register servo proxy agent. More... | |
virtual void | UnregisterAgent () |
Unregister servo proxy agent. | |
virtual bool | HasAgent () |
Tests if servo has a registered agent. More... | |
virtual int | AgentWriteGoalPos (int nGoalPos)=0 |
virtual int | AgentWriteGoalSpeed (int nGoalSpeed)=0 |
virtual int | AgentWriteGoalSpeedPos (int nGoalSpeed, int nGoalPos)=0 |
virtual int | MoveTo (int nGoalPos)=0 |
virtual int | MoveAtSpeedTo (int nGoalSpeed, int nGoalPos)=0 |
virtual int | MoveAtSpeed (int nGoalSpeed)=0 |
virtual int | EStop ()=0 |
virtual int | Stop ()=0 |
virtual int | Freeze ()=0 |
virtual int | Release ()=0 |
virtual int | CfgReadRotationLimits (uint_t *pCwLim, uint_t *pCcwLim)=0 |
virtual int | CfgWriteRotationLimits (uint_t uCwLim, uint_t uCcwLim)=0 |
virtual int | CfgReadTemperatureLimit (uint_t *pTempLim)=0 |
virtual int | CfgWriteTemperatureLimit (uint_t uTempLim)=0 |
virtual int | CfgReadVoltageLimits (uint_t *pMinVoltLim, uint_t *pMaxVoltLim)=0 |
virtual int | CfgWriteVoltageLimits (uint_t uMinVoltLim, uint_t uMaxVoltLim)=0 |
virtual int | CfgReadMaxTorqueLimit (uint_t *pMaxTorqueLim)=0 |
virtual int | CfgWriteMaxTorqueLimit (uint_t uMaxTorqueLim)=0 |
virtual int | CfgReadAlarmShutdownMask (uint_t *pAlarmMask)=0 |
virtual int | CfgWriteAlarmShutdownMask (uint_t uAlarmMask)=0 |
virtual int | CfgReadServoMode (uint_t *pServoMode)=0 |
virtual int | CfgWriteServoMode (uint_t uCwLim, uint_t uCcwLim)=0 |
virtual int | CfgWriteServoModeContinuous ()=0 |
virtual int | ReadTorqueEnable (bool *pState)=0 |
virtual int | WriteTorqueEnable (bool bState)=0 |
virtual int | ReadLed (bool *pState)=0 |
virtual int | WriteLed (bool bState)=0 |
virtual int | ReadControlMethod (DynaServoCtlMethod_T *pCtlMethod)=0 |
virtual int | WriteControlMethod (DynaServoCtlMethod_T &ctlMethod)=0 |
virtual int | ReadGoalPos (int *pGoalPos)=0 |
virtual int | WriteGoalPos (int nGoalPos)=0 |
virtual int | ReadGoalSpeed (int *pGoalSpeed)=0 |
virtual int | WriteGoalSpeed (int nGoalSpeed)=0 |
virtual int | ReadMaxTorqueLimit (uint_t *pMaxTorqueLim)=0 |
virtual int | WriteMaxTorqueLimit (uint_t uMaxTorqueLim)=0 |
virtual int | ReloadMaxTorqueLimit ()=0 |
virtual int | ReadCurPos (int *pCurPos)=0 |
virtual int | ReadCurSpeed (int *pCurSpeed)=0 |
virtual int | ReadCurLoad (int *pCurLoad)=0 |
virtual int | ReadDynamics (int *pCurPos, int *pCurSpeed, int *pCurLoad)=0 |
virtual int | ReadHealth (uint_t *pAlarms, int *pCurLoad, uint_t *pCurVolt, uint_t *pCurTemp)=0 |
virtual int | ReadIsMoving (bool *pState)=0 |
virtual int | Read (uint_t uAddr, uint_t *pVal)=0 |
virtual int | Write (uint_t uAddr, uint_t uVal)=0 |
virtual bool | Ping ()=0 |
virtual int | Reset ()=0 |
virtual int | SyncData ()=0 |
virtual int | SyncCfg ()=0 |
virtual int | SyncState ()=0 |
virtual void | Dump ()=0 |
Static Public Member Functions | |
static DynaServo * | New (DynaComm &comm, int nServoId) |
Archetype constructor to create a new Dynamixel servo instance. More... | |
static int | ReadModelNumber (DynaComm &comm, int nServoId, uint_t *pModelNum) |
Read the servo model number from the servo's EEPROM. More... | |
static int | ReadFirmwareVersion (DynaComm &comm, int nServoId, uint_t *pFwVer) |
Read the servo's firmware version from the servo's EEPROM. More... | |
static int | ReadServoId (DynaComm &comm, int nServoId, int *pServoId) |
Read the servo's id from the servo's EEPROM. More... | |
static int | WriteServoId (DynaComm &comm, int nServoId, int nNewServoId) |
Write the new servo id to the servo's EEPROM. More... | |
static int | ReadBaudRate (DynaComm &comm, int nServoId, int *pBaudRate) |
Read the servo's baud rate from the servo's EEPROM. More... | |
static int | WriteBaudRate (DynaComm &comm, int nServoId, int nNewBaudRate) |
Write the new baud rate to the servo's EEPROM. More... | |
static bool | Ping (DynaComm &comm, int nServoId) |
Ping the given servo. More... | |
static int | Reset (DynaComm &comm, int nServoId) |
Reset the given servo back to default values. More... | |
Protected Member Functions | |
void | Init (int nServoId, uint_t uModelNum, uint_t uFwVer) |
Initialize servo class instance. More... | |
virtual int | CalcMatesGoalPos (int nGoalPos, int *pGoalPosMate)=0 |
virtual int | CalcMatesGoalSpeed (int nGoalSpeed)=0 |
virtual uint_t | PackGoalSpeed (int nGoalSpeed)=0 |
virtual int | UnpackGoalSpeed (uint_t uVal)=0 |
virtual int | UnpackCurSpeed (uint_t uVal)=0 |
virtual int | UnpackCurLoad (uint_t uVal)=0 |
void | DumpCtlTbl (const char *sTblName, const DynaCtlTblEntry_T tblInfo[], size_t uSize) |
Dump the servo control tabl values to stdout. More... | |
Protected Attributes | |
DynaComm & | m_comm |
attached Dynamixel bus comm. object | |
int | m_nServoId |
servo id | |
DynaServoSpec_T | m_spec |
servo specification | |
DynaServoCfg_T | m_cfg |
servo shadowed EEPROM configuration | |
DynaServoState_T | m_state |
servo shadowed RAM state | |
CrossLink_T | m_link |
servo cross linkage | |
DynaAgent_T * | m_pAgent |
servo agent | |
void * | m_pAgentArg |
servo agent callback argument | |
int | m_nErrorCode |
class instance errored state | |
Dynamixel Servo Abstract Base Class.
The DynaServo abstract class provides the archetype functions to bootstrap into a specific DynaServo class object.
Definition at line 78 of file DynaServo.h.
|
inline |
Default initialization constructor.
comm | Dynamixel bus communication instance. |
nServoId | Servo Id. |
uModelNum | Servo model number. |
uFwVer | Servo firmware version. |
Definition at line 89 of file DynaServo.h.
References Init(), New(), and ~DynaServo().
|
inline |
Calculate the odometer value at the maximum encoder value.
Definition at line 354 of file DynaServo.h.
References DynaServoOdometer_T::m_nEncZeroPt, DynaServoOdometer_T::m_nOdDir, DynaServoState_T::m_od, m_spec, m_state, and DynaServoSpec_T::m_uRawPosMax.
|
inline |
Calculate the odometer value at the minimum (zero) encoder value.
Definition at line 344 of file DynaServo.h.
References DynaServoOdometer_T::m_nEncZeroPt, DynaServoOdometer_T::m_nOdDir, DynaServoState_T::m_od, and m_state.
|
inline |
Calculate serve direction to goal odometer position.
nOdGoalPos | Odometer goal position. |
Definition at line 380 of file DynaServo.h.
References DisableOdometer(), DYNA_MODE_CONTINUOUS, GetServoMode(), DynaServoOdometer_T::m_nOdDir, DynaServoOdometer_T::m_nOdometer, DynaServoState_T::m_od, m_state, ResetOdometer(), and UpdateOdometer().
|
pure virtual |
Convert raw temperature coding to degrees Celsius.
uTemp | Raw temperature value. |
Implemented in DynaServoGeneric.
Referenced by GetCurTemp().
|
pure virtual |
Convert raw volts coding to volts.
uTemp | Raw volts value. |
Implemented in DynaServoGeneric.
Referenced by GetCurVolt().
|
virtual |
Disable odometer mapping.
The odometer will always equal the encoder value.
Definition at line 242 of file DynaServo.cxx.
References DynaServoOdometer_T::m_bOdEnabled, DynaServoOdometer_T::m_nEncLastPos, DynaServoOdometer_T::m_nEncZeroPt, DynaServoOdometer_T::m_nOdDir, DynaServoOdometer_T::m_nOdometer, DynaServoState_T::m_od, m_state, and DynaServoState_T::m_uCurPos.
Referenced by CalcSpeedDir().
|
protected |
Dump the servo control tabl values to stdout.
sTblName | Name of the control table. |
tblInfo | Control table info. |
uSize | Control table info size (number of entries). |
Definition at line 422 of file DynaServo.cxx.
References DYNA_ECODE_BAD_VAL, DYNA_OK, DynaCtlTblEntry_T::m_bSigned, m_comm, m_nServoId, DynaCtlTblEntry_T::m_sFmt, DynaCtlTblEntry_T::m_sName, DynaCtlTblEntry_T::m_uAddr, DynaCtlTblEntry_T::m_uMask, DynaCtlTblEntry_T::m_uSize, DynaComm::Read16(), and DynaComm::Read8().
Referenced by DynaServoMX106::Dump(), DynaServoMX12W::Dump(), DynaServoMX28::Dump(), DynaServoMX64::Dump(), DynaServoEX106P::Dump(), and DynaServoGeneric::Dump().
|
inlinevirtual |
Get the current servo alarms.
Definition at line 435 of file DynaServo.h.
References m_state, and DynaServoState_T::m_uAlarms.
Referenced by DynaShellCmdClearAlarms::doExec().
|
inlinevirtual |
Get servo configuration.
Definition at line 195 of file DynaServo.h.
References m_cfg.
|
inlinevirtual |
Get the current servo load.
Definition at line 475 of file DynaServo.h.
References DynaServoState_T::m_nCurLoad, and m_state.
|
inlinevirtual |
Get the current servo position.
Definition at line 445 of file DynaServo.h.
References m_state, and DynaServoState_T::m_uCurPos.
|
inlinevirtual |
Get the current servo speed.
Definition at line 455 of file DynaServo.h.
References DynaServoState_T::m_nCurSpeed, and m_state.
Referenced by DynaBgThread::WriteGoalPos().
|
inlinevirtual |
Get the current temperature.
Definition at line 485 of file DynaServo.h.
References CvtRawTempToC(), m_state, and DynaServoState_T::m_uCurTemp.
|
inlinevirtual |
Get the current voltage.
Definition at line 504 of file DynaServo.h.
References CvtRawVoltToVolts(), m_state, and DynaServoState_T::m_uCurVolt.
|
inlinevirtual |
Get servo firmware version.
Definition at line 135 of file DynaServo.h.
References m_cfg, and DynaServoCfg_T::m_uFwVer.
Referenced by DynaShellCmdList::Exec().
|
inlinevirtual |
Get the goal servo speed.
Definition at line 465 of file DynaServo.h.
References DynaServoState_T::m_nGoalSpeed, and m_state.
|
inlinevirtual |
Get linked information.
Definition at line 256 of file DynaServo.h.
References DYNA_ID_NONE, GetServoId(), DynaServoLink_T::m_bRotReversed, DynaServo::CrossLink_T::m_bRotReversed, m_link, DynaServoLink_T::m_nServoIdMate, DynaServo::CrossLink_T::m_pServoMate, DynaServoLink_T::m_uLinkType, and DynaServo::CrossLink_T::m_uLinkType.
|
inlinevirtual |
Get servo model name string.
Definition at line 145 of file DynaServo.h.
References DynaServoSpec_T::m_sModelName, and m_spec.
Referenced by DynaChain::ChainEntryDelete(), DynaChain::ChainEntryNew(), DynaShellCmdList::Exec(), and DynaChain::LinkServos().
|
inlinevirtual |
Get servo model number.
Definition at line 125 of file DynaServo.h.
References m_cfg, and DynaServoCfg_T::m_uModelNum.
Referenced by DynaChain::AuditLinks(), DynaChain::ChainEntryDelete(), DynaChain::ChainEntryNew(), DynaShellCmdList::Exec(), DynaShellCmdTrain::Exec(), DynaShellCmdPlay::Exec(), and DynaChain::LinkServos().
|
inline |
Get the current virtual odometer value.
Definition at line 304 of file DynaServo.h.
References DynaServoOdometer_T::m_nOdometer, DynaServoState_T::m_od, and m_state.
Referenced by DynaServoGeneric::CalcMatesGoalPos(), DynaShellCmdGetOdometer::doExec(), DynaBgThread::execPosCtl(), DynaBgThread::execTorqueCtl(), DynaVServo::getGoalDir(), DynaServoGeneric::ReadCurPos(), DynaBgThread::stopPosCtl(), and DynaBgThread::WriteGoalPos().
|
inline |
Get the virtual odometer zero point.
Definition at line 324 of file DynaServo.h.
References DynaServoOdometer_T::m_nEncZeroPt, DynaServoState_T::m_od, and m_state.
Referenced by DynaShellCmdGetOdometer::doExec().
|
inlinevirtual |
Get servo id.
Definition at line 155 of file DynaServo.h.
References m_nServoId.
Referenced by DynaServoGeneric::CfgWriteAlarmShutdownMask(), DynaServoEX106P::CfgWriteDriveMode(), DynaServoGeneric::CfgWriteMaxTorqueLimit(), DynaServoGeneric::CfgWriteRotationLimits(), DynaServoGeneric::CfgWriteTemperatureLimit(), DynaServoGeneric::CfgWriteVoltageLimits(), DynaShellCmdGetPid::doExec(), DynaShellCmdGetOdometer::doExec(), DynaShellCmdCfgWriteServoMode::doExec(), DynaShellCmdReadTorqueEnable::doExec(), DynaShellCmdWriteTorqueEnable::doExec(), DynaShellCmdReadGoalPos::doExec(), DynaShellCmdReadGoalSpeed::doExec(), DynaShellCmdWriteGoalSpeed::doExec(), DynaShellCmdGetSoftTorqueTh::doExec(), DynaShellCmdReadCurPos::doExec(), DynaShellCmdReadCurSpeed::doExec(), DynaShellCmdReadDynamics::doExec(), DynaShellCmdReadHealth::doExec(), DynaShellCmdReadIsMoving::doExec(), DynaShellCmdClearAlarms::doExec(), DynaShellCmdDump::doExec(), DynaBgThread::execPosCtl(), DynaBgThread::execTorqueCtl(), GetLinkInfo(), DynaBgThread::getRegisteredServo(), DynaBgThread::monitorDynamics(), DynaBgThread::monitorHealth(), DynaBgThread::RegisterServoAgent(), DynaBgThread::stopPosCtl(), DynaChain::SyncWriteGoalPos(), DynaChain::SyncWriteGoalSpeed(), DynaServoGeneric::WriteCtlMethodCompliance(), DynaServoGeneric::WriteCtlMethodPid(), DynaServoGeneric::WriteGoalPos(), DynaServoGeneric::WriteGoalSpeed(), DynaServoGeneric::WriteLed(), DynaServoGeneric::WriteMaxTorqueLimit(), and DynaServoGeneric::WriteTorqueEnable().
|
inlinevirtual |
Get the servo operational mode.
Definition at line 165 of file DynaServo.h.
References m_cfg, and DynaServoCfg_T::m_uServoMode.
Referenced by CalcSpeedDir(), DynaShellCmdReadGoalPos::doExec(), DynaShellCmdReadGoalSpeed::doExec(), DynaShellCmdReadCurPos::doExec(), DynaShellCmdList::Exec(), DynaBgThread::execPosCtl(), DynaBgThread::execTorqueCtl(), DynaVServo::setToleranceInTicks(), DynaServoGeneric::Stop(), DynaBgThread::stopMotion(), DynaChain::SyncMoveTo(), DynaChain::SyncWriteGoalPos(), and DynaBgThread::WriteGoalPos().
|
inlinevirtual |
Get soft torque thresholds.
The thresholds are used as a hystersis to software control servo torque.
[out] | uOverTorqueTh | High threshold where the servo is set in an over torque condition. |
[out] | uClearTorqueTh | Low threshold where the servo is cleared of an over torque condition. |
Definition at line 546 of file DynaServo.h.
References m_state, DynaServoState_T::m_uClearTorqueTh, and DynaServoState_T::m_uOverTorqueTh.
Referenced by DynaShellCmdGetSoftTorqueTh::doExec(), DynaBgThread::execTorqueCtl(), and DynaBgThread::monitorDynamics().
|
inlinevirtual |
Get servo specification.
Definition at line 185 of file DynaServo.h.
References m_spec.
Referenced by DynaShellCmdCfgWriteServoMode::doExec(), and DynaVServo::setToleranceInTicks().
|
inlinevirtual |
Get servo state.
Definition at line 205 of file DynaServo.h.
References m_state.
Referenced by DynaBgThread::execDynamics().
|
inlinevirtual |
Test if servo has 360 ° positioning information.
Definition at line 175 of file DynaServo.h.
References DynaServoSpec_T::m_bHas360Pos, and m_spec.
|
inlinevirtual |
Tests if servo has a registered agent.
Definition at line 604 of file DynaServo.h.
References m_pAgent, Ping(), ReadBaudRate(), ReadFirmwareVersion(), ReadModelNumber(), ReadServoId(), Reset(), WriteBaudRate(), and WriteServoId().
Referenced by DynaServoGeneric::MoveAtSpeedTo(), DynaServoGeneric::MoveTo(), DynaServoGeneric::Stop(), and DynaChain::SyncMoveAtSpeedTo().
|
inlinevirtual |
Test if servo is in a soft over torque condition.
Definition at line 568 of file DynaServo.h.
References DynaServoState_T::m_bOverTorqueCond, and m_state.
Referenced by DynaBgThread::monitorDynamics().
|
protected |
Initialize servo class instance.
comm | Dynamixel bus communication instance. |
nServoId | Servo Id. |
uModelNum | Servo model number. |
uFwVer | Servo firmware version. |
Definition at line 406 of file DynaServo.cxx.
References m_cfg, DynaServoCfg_T::m_nServoId, m_nServoId, m_pAgent, m_pAgentArg, DynaServoSpec_T::m_sModelName, m_spec, DynaServoCfg_T::m_uFwVer, DynaServoCfg_T::m_uModelNum, newstr(), and Unlink().
Referenced by DynaServo(), DynaServoAX12::Init(), DynaServoRX64::Init(), DynaServoRX10::Init(), DynaServoRX24F::Init(), DynaServoRX28::Init(), DynaServoMX64::Init(), DynaServoMX12W::Init(), DynaServoMX28::Init(), DynaServoMX106::Init(), and DynaServoEX106P::Init().
|
inline |
Test if this servo is a linked master.
A linked master is the master servo in a linked master-slave configuration.
Definition at line 236 of file DynaServo.h.
References DYNA_LINK_MASTER, m_link, and DynaServo::CrossLink_T::m_uLinkType.
Referenced by DynaServoGeneric::CfgReadAlarmShutdownMask(), DynaServoEX106P::CfgReadDriveMode(), DynaServoGeneric::CfgReadMaxTorqueLimit(), DynaServoGeneric::CfgReadRotationLimits(), DynaServoGeneric::CfgReadServoMode(), DynaServoGeneric::CfgReadTemperatureLimit(), DynaServoGeneric::CfgReadVoltageLimits(), DynaServoGeneric::CfgWriteAlarmShutdownMask(), DynaServoEX106P::CfgWriteDriveMode(), DynaServoGeneric::CfgWriteMaxTorqueLimit(), DynaServoGeneric::CfgWriteRotationLimits(), DynaServoGeneric::CfgWriteTemperatureLimit(), DynaServoGeneric::CfgWriteVoltageLimits(), DynaServoGeneric::ReadCtlMethodCompliance(), DynaServoGeneric::ReadCtlMethodPid(), DynaServoGeneric::ReadCurLoad(), DynaServoGeneric::ReadCurPos(), DynaServoGeneric::ReadCurSpeed(), DynaServoGeneric::ReadGoalPos(), DynaServoGeneric::ReadGoalSpeed(), DynaServoGeneric::ReadHealth(), DynaServoGeneric::ReadIsMoving(), DynaServoGeneric::ReadLed(), DynaServoGeneric::ReadMaxTorqueLimit(), DynaServoEX106P::ReadSensedCurrent(), DynaServoGeneric::ReadTorqueEnable(), DynaServoGeneric::WriteCtlMethodCompliance(), DynaServoGeneric::WriteCtlMethodPid(), DynaServoGeneric::WriteGoalPos(), DynaServoGeneric::WriteGoalSpeed(), DynaServoGeneric::WriteLed(), DynaServoGeneric::WriteMaxTorqueLimit(), and DynaServoGeneric::WriteTorqueEnable().
|
inline |
Test if this 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).
Definition at line 223 of file DynaServo.h.
References DYNA_LINK_MASTER, DYNA_LINK_NONE, m_link, and DynaServo::CrossLink_T::m_uLinkType.
Referenced by DynaShellCmd::ChkChainIsMasterServo().
|
inline |
Test if virtual odometer mapping is enabled.
Definition at line 314 of file DynaServo.h.
References DynaServoOdometer_T::m_bOdEnabled, DynaServoState_T::m_od, and m_state.
|
inline |
Test if the virtual odometer is reversed.
Definition at line 334 of file DynaServo.h.
References DynaServoOdometer_T::m_nOdDir, DynaServoState_T::m_od, and m_state.
Referenced by DynaShellCmdGetOdometer::doExec(), DynaVServo::getGoalDir(), and DynaBgThread::WriteGoalPos().
|
inline |
Test if this servo is unlinked.
Definition at line 246 of file DynaServo.h.
References DYNA_LINK_NONE, m_link, and DynaServo::CrossLink_T::m_uLinkType.
|
inlinevirtual |
Link this servo to another.
uLinkType | This servo's linked type. See Dynamixel Servo Link Types. |
pServoMate | This servo's linked mate. |
bRotReversed | The linked servos do [not] rotate in opposite directions. |
Definition at line 277 of file DynaServo.h.
References DynaServo::CrossLink_T::m_bRotReversed, m_link, DynaServo::CrossLink_T::m_pServoMate, and DynaServo::CrossLink_T::m_uLinkType.
Referenced by DynaChain::AuditLinks(), and DynaChain::LinkServos().
Archetype constructor to create a new Dynamixel servo instance.
The specific DynaServo object created depends on both the servo's model number and firmware version stored in the servo's EEPROM.
comm | Dynamixel bus communication instance. |
nServoId | Servo id. |
Definition at line 102 of file DynaServo.cxx.
References DYNA_LOG_ERROR, DynaServoGeneric::DYNA_MODEL_NUM, DynaServoMX12W::DYNA_MODEL_NUM, DynaServoRX28::DYNA_MODEL_NUM, DynaServoMX106::DYNA_MODEL_NUM, DynaServoRX10::DYNA_MODEL_NUM, DynaServoRX24F::DYNA_MODEL_NUM, DynaServoMX64::DYNA_MODEL_NUM, DynaServoMX28::DYNA_MODEL_NUM, DynaServoRX64::DYNA_MODEL_NUM, DynaServoEX106P::DYNA_MODEL_NUM, ReadFirmwareVersion(), and ReadModelNumber().
Referenced by DynaChain::ChainEntryNew(), and DynaServo().
|
inline |
Convert virtual odometer units to servo encoder units.
nOdPos | Odometer position. |
Definition at line 367 of file DynaServo.h.
References imod(), DynaServoOdometer_T::m_nEncZeroPt, DynaServoOdometer_T::m_nOdDir, DynaServoState_T::m_od, m_spec, m_state, and DynaServoSpec_T::m_uRawPosModulo.
Referenced by DynaServoGeneric::CalcMatesGoalPos(), DynaChain::SyncWriteGoalPos(), and DynaServoGeneric::WriteGoalPos().
|
static |
Ping the given servo.
comm | Dynamixel bus communication instance. |
nServoId | Servo id. |
Definition at line 383 of file DynaServo.cxx.
References DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, DynaComm::Ping(), and Ping().
Referenced by HasAgent(), and Ping().
|
static |
Read the servo's baud rate from the servo's EEPROM.
comm | Dynamixel bus communication instance. | |
nServoId | Servo id. | |
[out] | pBaudRate | Baud rate. |
Definition at line 327 of file DynaServo.cxx.
References DynaComm::BaudNumToRate(), DYNA_ADDR_BAUD_RATE, DYNA_LOG_ERROR, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and DynaComm::Read8().
Referenced by HasAgent().
|
static |
Read the servo's firmware version from the servo's EEPROM.
comm | Dynamixel bus communication instance. | |
nServoId | Servo id. | |
[out] | pFwVer | Pointer to read servo firmware version. |
Definition at line 276 of file DynaServo.cxx.
References DYNA_ADDR_FWVER, DYNA_ADDR_FWVER_MASK, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and DynaComm::Read8().
Referenced by HasAgent(), and New().
|
static |
Read the servo model number from the servo's EEPROM.
comm | Dynamixel bus communication instance. | |
nServoId | Servo id. | |
[out] | pModelNum | Pointer to read servo model number. |
Definition at line 256 of file DynaServo.cxx.
References DYNA_ADDR_MODEL_NUM_LSB, DYNA_ADDR_MODEL_NUM_MASK, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and DynaComm::Read16().
Referenced by DynaShellCmdMegaScan::Exec(), HasAgent(), and New().
|
static |
Read the servo's id from the servo's EEPROM.
comm | Dynamixel bus communication instance. | |
nServoId | Servo id. | |
[out] | pServoId | Pointer to read servo servo id. |
Definition at line 296 of file DynaServo.cxx.
References DYNA_ADDR_ID, DYNA_ADDR_ID_MASK, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and DynaComm::Read8().
Referenced by HasAgent().
|
inlinevirtual |
Register servo proxy agent.
pAgent | Pointer to agent calls. |
pAgentArg | Agent supplied Argument passed back to calls. |
Definition at line 584 of file DynaServo.h.
References m_pAgent, and m_pAgentArg.
Referenced by DynaBgThread::RegisterChainAgent(), and DynaBgThread::RegisterServoAgent().
|
static |
Reset the given servo back to default values.
comm | Dynamixel bus communication instance. |
nServoId | Servo id. |
Definition at line 391 of file DynaServo.cxx.
References DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, DynaComm::Reset(), and Reset().
Referenced by HasAgent(), and Reset().
|
virtual |
Reset the servo's virtual odometer.
The odometer mapping is enabled.
nEncZeroPt | Zero point position in servo raw encoder position units. |
bIsReverse | Do [not] reverse rotation sense. |
Definition at line 188 of file DynaServo.cxx.
References DynaServoOdometer_T::m_bOdEnabled, DynaServoOdometer_T::m_nEncLastPos, DynaServoOdometer_T::m_nEncZeroPt, DynaServoOdometer_T::m_nOdDir, DynaServoOdometer_T::m_nOdometer, DynaServoState_T::m_od, m_state, and DynaServoState_T::m_uCurPos.
Referenced by CalcSpeedDir(), DynaShellCmdSetOdometer::Exec(), and DynaServoGeneric::SyncState().
|
inlinevirtual |
Set or clear servo in soft over torque condition.
bNewCond | Servo [not] in over torque condition. |
Definition at line 558 of file DynaServo.h.
References DynaServoState_T::m_bOverTorqueCond, and m_state.
Referenced by DynaBgThread::monitorDynamics().
|
inlinevirtual |
Set soft torque thresholds.
The thresholds are used as a hystersis to software control servo torque.
uOverTorqueTh | High threshold where the servo is set in an over torque condition. |
uClearTorqueTh | Low threshold where the servo is cleared of an over torque condition. |
Definition at line 528 of file DynaServo.h.
References DynaServoState_T::m_bOverTorqueCond, m_state, DynaServoState_T::m_uClearTorqueTh, and DynaServoState_T::m_uOverTorqueTh.
Referenced by DynaShellCmdSetSoftTorqueTh::Exec().
|
virtual |
Update the odometer from the current servo position and rotation direction.
nEncCurPos | Servo encoder current position in raw ticks. |
Definition at line 207 of file DynaServo.cxx.
References iabs(), DynaServoOdometer_T::m_bOdEnabled, DynaServoOdometer_T::m_nEncLastPos, DynaServoOdometer_T::m_nOdDir, DynaServoOdometer_T::m_nOdometer, DynaServoState_T::m_od, m_spec, m_state, and DynaServoSpec_T::m_uRawPosMax.
Referenced by CalcSpeedDir(), and DynaServoGeneric::ReadCurPos().
|
static |
Write the new baud rate to the servo's EEPROM.
comm | Dynamixel bus communication instance. |
nServoId | Servo id. |
nNewBaudRate | New baud rate. |
Definition at line 357 of file DynaServo.cxx.
References DynaComm::BaudRateToNum(), DYNA_ADDR_BAUD_RATE, DYNA_LOG_ERROR, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and DynaComm::Write8().
Referenced by HasAgent().
|
static |
Write the new servo id to the servo's EEPROM.
comm | Dynamixel bus communication instance. |
nServoId | Servo id. |
nNewServoId | New servo id. |
Definition at line 316 of file DynaServo.cxx.
References DYNA_ADDR_ID, DYNA_TRY_COMM, DYNA_TRY_SERVO_ID, and DynaComm::Write8().
Referenced by HasAgent().