![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
Generic Dynamixel Servo Base Class. More...
#include <DynaServoGeneric.h>
Public Member Functions | |
DynaServoGeneric (DynaComm &comm) | |
Bare-bones initialization constructor. More... | |
DynaServoGeneric (DynaComm &comm, int nServoId, uint_t uModelNum=DYNA_MODEL_NUM, uint_t uFwVer=DYNA_FWVER_NA) | |
Initialization constructor. More... | |
virtual | ~DynaServoGeneric () |
Destructor. | |
virtual float | CvtRawTempToC (uint uTemp) |
Convert raw temperature coding to degrees Celsius. More... | |
virtual float | CvtRawVoltToVolts (uint uVolts) |
Convert raw volts coding to volts. More... | |
virtual int | AgentWriteGoalPos (int nGoalOdPos) |
Agent write to the servo state memory to set the new goal position. More... | |
virtual int | AgentWriteGoalSpeed (int nGoalSpeed) |
Agent write to the servo state memory to set the new goal speed. More... | |
virtual int | AgentWriteGoalSpeedPos (int nGoalSpeed, int nGoalOdPos) |
Agent write to the servo state memory to set the new goal position and speed. More... | |
virtual int | MoveTo (int nGoalOdPos) |
Move to the goal postition. More... | |
virtual int | MoveAtSpeedTo (int nGoalSpeed, int nGoalOdPos) |
Move at speed to the goal postition. More... | |
virtual int | MoveAtSpeed (int nGoalSpeed) |
Move at speed. More... | |
virtual int | EStop () |
Emergency stop servo. More... | |
virtual int | Stop () |
Stop servo. More... | |
virtual int | Freeze () |
Freeze servo at current position. More... | |
virtual int | Release () |
Release servo from any applied torque. More... | |
virtual int | CfgReadRotationLimits (uint_t *pCwLim, uint_t *pCcwLim) |
Read from the servo configuration EEPROM the current rotation limits. More... | |
virtual int | CfgWriteRotationLimits (uint_t uCwLim, uint_t uCcwLim) |
Write to the servo configuration EEPROM the new rotation limits. More... | |
virtual int | CfgReadTemperatureLimit (uint_t *pTempLim) |
Read from the servo configuration EEPROM the current maximum temperature limit. More... | |
virtual int | CfgWriteTemperatureLimit (uint_t uTempLim) |
Write to the servo configuration EEPROM the new maximum temperature limit. More... | |
virtual int | CfgReadVoltageLimits (uint_t *pMinVoltLim, uint_t *pMaxVoltLim) |
Read from the servo configuration EEPROM the current voltage limits. More... | |
virtual int | CfgWriteVoltageLimits (uint_t uMinVoltLim, uint_t uMaxVoltLim) |
Write to the servo configuration EEPROM the new voltage limits. More... | |
virtual int | CfgReadMaxTorqueLimit (uint_t *pMaxTorqueLim) |
Read from the servo configuration EEPROM the current on power-up maximum torque limit. More... | |
virtual int | CfgWriteMaxTorqueLimit (uint_t uMaxTorqueLim) |
Write to the servo configuration EEPROM the new on power-up maximum torque limit. More... | |
virtual int | CfgReadAlarmShutdownMask (uint_t *pAlarmMask) |
Read from the servo configuration EEPROM the current servo shutdown on alarms mask. More... | |
virtual int | CfgWriteAlarmShutdownMask (uint_t uAlarmMask) |
Write to the servo configuration EEPROM the new servo shutdown on alarms mask. More... | |
virtual int | CfgReadServoMode (uint_t *pServoMode) |
Read from the servo configuration EEPROM to determine the servo operational mode. More... | |
virtual int | CfgWriteServoMode (uint_t uCwLim, uint_t uCcwLim) |
Write to the servo configuration EEPROM to set the servo operational mode. More... | |
virtual int | CfgWriteServoModeContinuous () |
Write to the servo configuration EEPROM to set the servo operational mode to the full/continuous mode. More... | |
virtual int | ReadTorqueEnable (bool *pState) |
Read from the servo state memory the current torque enable value. More... | |
virtual int | WriteTorqueEnable (bool bState) |
Write to the servo state memory to set the new torque enable value. More... | |
virtual int | ReadLed (bool *pState) |
Read from the servo state memory the current LED on/off value. More... | |
virtual int | WriteLed (bool bState) |
Write to the servo state memory to turn on or off the servo LED. More... | |
virtual int | ReadControlMethod (DynaServoCtlMethod_T *pCtlMethod) |
Read from the servo state memory the current control method parameters. More... | |
virtual int | WriteControlMethod (DynaServoCtlMethod_T &ctlMethod) |
Write to the servo state memory the new control method parameters. More... | |
virtual int | ReadGoalPos (int *pGoalPos) |
Read from the servo state memory the current goal position. More... | |
virtual int | WriteGoalPos (int nGoalOdPos) |
Write to the servo state memory to set the new goal position. More... | |
virtual int | ReadGoalSpeed (int *pGoalSpeed) |
Read from the servo state memory the current goal speed and direction. More... | |
virtual int | WriteGoalSpeed (int nGoalSpeed) |
Write to the servo state memory the new goal speed and direction. More... | |
virtual int | ReadMaxTorqueLimit (uint_t *pMaxTorqueLim) |
Read from the servo state memory the current maximum torque limit. More... | |
virtual int | WriteMaxTorqueLimit (uint_t uMaxTorqueLim) |
Write to the servo state memory to set the new maximum torque limit. More... | |
virtual int | ReloadMaxTorqueLimit () |
Reload the maximum torque limit from the configuration. More... | |
virtual int | ReadCurPos (int *pCurOdPos) |
Read from the servo state memory the current servo position. More... | |
virtual int | ReadCurSpeed (int *pCurSpeed) |
Read from the servo state memory the current speed and direction. More... | |
virtual int | ReadCurLoad (int *pCurLoad) |
Read from the servo state memory the current load. More... | |
virtual int | ReadDynamics (int *pCurPos, int *pCurSpeed, int *pCurLoad) |
Read from the servo state memory the current servo dynamics. More... | |
virtual int | ReadHealth (uint_t *pAlarms, int *pCurLoad, uint_t *pCurVolt, uint_t *pCurTemp) |
Read from the servo state memory the current servo health. More... | |
virtual int | ReadIsMoving (bool *pState) |
Read from the servo state memory to test if the servo is currently moving. More... | |
virtual int | Read (uint_t uAddr, uint_t *pVal) |
virtual int | Write (uint_t uAddr, uint_t uVal) |
virtual bool | Ping () |
Ping this servo. More... | |
virtual int | Reset () |
Reset this servo back to default values. More... | |
virtual int | SyncData () |
Synchronize the shadowed configuration and state data to the servo control table. More... | |
virtual int | SyncCfg () |
Synchronize the shadowed configuration to the servo control table EEPROM configuration. More... | |
virtual int | SyncState () |
Synchronize the shadowed state data to the servo control table RAM state. More... | |
virtual void | Dump () |
Dump contents of the servo EEPROM and RAM control tables. | |
![]() | |
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 uint_t | GetCurVolt () const |
Get the current voltage. 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... | |
Static Public Attributes | |
static const int | DYNA_MODEL_NUM = DYNA_MODEL_NUM_GENERIC |
Protected Member Functions | |
void | Init () |
Initialize servo class instance. | |
void | InitSpec () |
Initialize servo fixed specification data. | |
void | InitCfg () |
Initialize servo configuration data. | |
void | InitState () |
Initialize servo state data. | |
virtual void | CheckData () |
Check data for consitencies. More... | |
void | SetServoMode () |
Set the servo mode given the servo capabilites and the current rotation limits. More... | |
virtual int | CalcMatesGoalPos (int nGoalOdPos, int *pGoalOdPosMate) |
Calculate the linked mate's goal position given this servo's goal position. More... | |
virtual int | CalcMatesGoalSpeed (int nGoalSpeed) |
Calculate the linked mate's speed speed given this servo's goal speed. More... | |
virtual int | ReadCtlMethodCompliance (DynaServoCtlMethod_T *pCtlMethod) |
Read from the servo state memory the current compliance control method parameters. More... | |
virtual int | WriteCtlMethodCompliance (DynaServoCtlMethod_T &ctlMethod) |
Write to the servo state memory the new compliance control method parameters. More... | |
virtual int | ReadCtlMethodPid (DynaServoCtlMethod_T *pCtlMethod) |
Read from the servo state memory the current PID control method parameters. More... | |
virtual int | WriteCtlMethodPid (DynaServoCtlMethod_T &ctlMethod) |
Write to the servo state memory the new PID control method parameters. More... | |
virtual bool | ChkComplianceSlope (uint_t uVal) |
Check validity of compliance slope discrete values. More... | |
virtual uint_t | PackGoalSpeed (int nGoalSpeed) |
Pack the goal speed into the control table value. More... | |
virtual int | UnpackGoalSpeed (uint_t uVal) |
Unpack goal speed from the control table value. More... | |
virtual int | UnpackCurSpeed (uint_t uVal) |
Unpack current speed from the control table value. More... | |
virtual int | UnpackCurLoad (uint_t uVal) |
Unpack current load estimate from the control table value. More... | |
![]() | |
void | Init (int nServoId, uint_t uModelNum, uint_t uFwVer) |
Initialize servo class instance. More... | |
void | DumpCtlTbl (const char *sTblName, const DynaCtlTblEntry_T tblInfo[], size_t uSize) |
Dump the servo control tabl values to stdout. More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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 | |
Generic Dynamixel Servo Base Class.
The DynaServo base class provides the most commonly used interface functions for the various Dynamixel series servos.
Definition at line 75 of file DynaServoGeneric.h.
|
inline |
Bare-bones initialization constructor.
May be used be derived classes to avoid undue communication and initializaton overhead.
comm | Dynamixel bus communication instance. |
Definition at line 90 of file DynaServoGeneric.h.
References DYNA_FWVER_NA, and ~DynaServoGeneric().
DynaServoGeneric::DynaServoGeneric | ( | DynaComm & | comm, |
int | nServoId, | ||
uint_t | uModelNum = DYNA_MODEL_NUM , |
||
uint_t | uFwVer = DYNA_FWVER_NA |
||
) |
Initialization constructor.
comm | Dynamixel bus communication instance. |
nServoId | Servo Id. |
uModelNum | Servo model number. |
uFwVer | Servo firmware version. |
Definition at line 134 of file DynaServoGeneric.cxx.
References CheckData(), Init(), and SyncData().
|
virtual |
Agent write to the servo state memory to set the new goal position.
If the operation requires a servo proxy agent, then a call is made to the registered agent, if any. Otherwise a direct write to the servo is made.
nGoalPos | Goal position (odometer ticks). |
Implements DynaServo.
Definition at line 155 of file DynaServoGeneric.cxx.
References DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_AGENT, DYNA_TRY_SERVO_HAS_POS_CTL, DynaServo::m_comm, DynaAgent_T::m_fnWriteGoalPos, DynaServoOdometer_T::m_nOdGoalPos, DynaServo::m_nServoId, DynaServoState_T::m_od, DynaServo::m_pAgent, DynaServo::m_pAgentArg, and DynaServo::m_state.
Referenced by CvtRawVoltToVolts(), and MoveTo().
|
virtual |
Agent write to the servo state memory to set the new goal speed.
If the operation requires a servo proxy agent, then a call is made to the registered agent, if any. Otherwise a direct write to the servo is made.
nGoalSpeed | Goal speed (raw). |
Implements DynaServo.
Definition at line 170 of file DynaServoGeneric.cxx.
References DYNA_ECODE_BAD_VAL, DYNA_SPEED_MAX_RAW, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_AGENT, DYNA_TRY_SERVO_HAS_POS_CTL, iabs(), DynaServo::m_comm, DynaAgent_T::m_fnWriteGoalSpeed, DynaServo::m_nServoId, DynaServo::m_pAgent, and DynaServo::m_pAgentArg.
Referenced by CvtRawVoltToVolts(), and Stop().
|
virtual |
Agent write to the servo state memory to set the new goal position and speed.
If the operation requires a servo proxy agent, then a call is made to the registered agent, if any. Otherwise a direct write to the servo is made.
nGoalOdPos | Goal position (odometer ticks). |
nGoalSpeed | Goal speed (raw). |
Implements DynaServo.
Definition at line 188 of file DynaServoGeneric.cxx.
References DYNA_ECODE_BAD_VAL, DYNA_SPEED_MAX_RAW, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_AGENT, DYNA_TRY_SERVO_HAS_POS_CTL, iabs(), DynaServo::m_comm, DynaAgent_T::m_fnWriteGoalSpeedPos, DynaServoOdometer_T::m_nOdGoalPos, DynaServo::m_nServoId, DynaServoState_T::m_od, DynaServo::m_pAgent, DynaServo::m_pAgentArg, and DynaServo::m_state.
Referenced by CvtRawVoltToVolts(), and MoveAtSpeedTo().
|
protectedvirtual |
Calculate the linked mate's goal position given this servo's goal position.
nGoalOdPos | Goal position (odometer ticks). | |
[out] | pGoalOdPosMate | Mate's calculated goal position (odometer ticks). |
Implements DynaServo.
Definition at line 1725 of file DynaServoGeneric.cxx.
References DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_TRY_EXPR, DYNA_TRY_RC, DynaServo::GetOdometer(), DynaServo::CrossLink_T::m_bRotReversed, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServoSpec_T::m_uRawPosMax, DynaServoSpec_T::m_uRawPosMin, DynaServo::OdometerToEncoder(), and ReadCurPos().
Referenced by CvtRawVoltToVolts(), and WriteGoalPos().
|
inlineprotectedvirtual |
Calculate the linked mate's speed speed given this servo's goal speed.
Implements DynaServo.
Definition at line 1043 of file DynaServoGeneric.h.
References ChkComplianceSlope(), DynaServo::CrossLink_T::m_bRotReversed, DynaServo::m_link, PackGoalSpeed(), ReadCtlMethodCompliance(), ReadCtlMethodPid(), UnpackCurLoad(), UnpackCurSpeed(), UnpackGoalSpeed(), WriteCtlMethodCompliance(), and WriteCtlMethodPid().
Referenced by WriteGoalSpeed().
|
virtual |
Read from the servo configuration EEPROM the current servo shutdown on alarms mask.
If this servo is the master in a linked pair of servos, both servos' configuration data are read.
[out] | pAlarmMask | Shutdown alarm mask. |
Implements DynaServo.
Definition at line 702 of file DynaServoGeneric.cxx.
References DYNA_ADDR_ALARM_SHUTDOWN, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServoCfg_T::m_uAlarmShutdown, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and SyncCfg().
|
virtual |
Read from the servo configuration EEPROM the current on power-up maximum torque limit.
If this servo is the master in a linked pair of servos, both servos' configuration data are read.
[out] | pMaxTorqueLim | Maximum torque limit. |
Implements DynaServo.
Definition at line 634 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_TORQUE_MAX_ON_LSB, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServoCfg_T::m_uLimTorqueMax, and DynaComm::Read16().
Referenced by CvtRawVoltToVolts(), and SyncCfg().
|
virtual |
Read from the servo configuration EEPROM the current rotation limits.
If this servo is the master in a linked pair of servos, both servos' configuration data are read.
[out] | pCwLim | Clockwise limit. |
[out] | pCcwLim | Counterclockwise limit. |
Implements DynaServo.
Definition at line 361 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_CCW_LSB, DYNA_ADDR_LIM_CW_LSB, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServoCfg_T::m_uLimCcw, DynaServoCfg_T::m_uLimCw, DynaComm::Read16(), and SetServoMode().
Referenced by CfgReadServoMode(), CvtRawVoltToVolts(), and SyncCfg().
|
virtual |
Read from the servo configuration EEPROM to determine the servo operational mode.
If this servo is the master in a linked pair of servos, both servos' configuration data are read.
[out] | pServoMode | Servo mode. |
Implements DynaServo.
Definition at line 765 of file DynaServoGeneric.cxx.
References CfgReadRotationLimits(), DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::CrossLink_T::m_pServoMate, and DynaServoCfg_T::m_uServoMode.
Referenced by CvtRawVoltToVolts().
|
virtual |
Read from the servo configuration EEPROM the current maximum temperature limit.
If this servo is the master in a linked pair of servos, both servos' configuration data are read.
[out] | pTempLim | Temperature limit. |
Implements DynaServo.
Definition at line 469 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_TEMP_MAX, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServoCfg_T::m_uLimTemp, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and SyncCfg().
|
virtual |
Read from the servo configuration EEPROM the current voltage limits.
If this servo is the master in a linked pair of servos, both servos' configuration data are read.
[out] | pMinVoltLim | Minimum voltage limit. |
[out] | pMaxVoltLim | Maximum voltage limit. |
Implements DynaServo.
Definition at line 535 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_VOLT_MAX, DYNA_ADDR_LIM_VOLT_MIN, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServoCfg_T::m_uLimVoltMax, DynaServoCfg_T::m_uLimVoltMin, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and SyncCfg().
|
virtual |
Write to the servo configuration EEPROM the new servo shutdown on alarms mask.
uAlarmMask | Shutdown alarm mask. |
Implements DynaServo.
Definition at line 724 of file DynaServoGeneric.cxx.
References DYNA_ADDR_ALARM_SHUTDOWN, DYNA_ADDR_ALARM_SHUTDOWN_MASK, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServoCfg_T::m_uAlarmShutdown, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CvtRawVoltToVolts().
|
virtual |
Write to the servo configuration EEPROM the new on power-up maximum torque limit.
If this servo is the master in a linked pair of servos, both servos' configuration data are written.
uMaxTorqueLim | Maximum torque limit. |
Implements DynaServo.
Definition at line 657 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_TORQUE_MAX_ON_LSB, DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServoCfg_T::m_uLimTorqueMax, DynaServoSpec_T::m_uRawTorqueMax, DynaServoSpec_T::m_uRawTorqueMin, DynaComm::vSyncWrite(), and DynaComm::Write16().
Referenced by CvtRawVoltToVolts().
|
virtual |
Write to the servo configuration EEPROM the new rotation limits.
If this servo is the master in a linked pair of servos, both servos' configuration data are written.
uCwLim | Clockwise limit. |
uCcwLim | Counterclockwise limit. |
Implements DynaServo.
Definition at line 394 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_CCW_LSB, DYNA_ADDR_LIM_CW_LSB, DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServoCfg_T::m_uLimCcw, DynaServoCfg_T::m_uLimCw, DynaServoSpec_T::m_uRawPosMax, DynaServoSpec_T::m_uRawPosMin, SetServoMode(), DynaComm::vSyncWrite(), and DynaComm::Write16().
Referenced by CfgWriteServoMode(), CfgWriteServoModeContinuous(), and CvtRawVoltToVolts().
|
virtual |
Write to the servo configuration EEPROM to set the servo operational mode.
If this servo is the master in a linked pair of servos, both servos' configuration data are written.
uCwLim | Clockwise limit. |
uCcwLim | Counterclockwise limit. |
Implements DynaServo.
Definition at line 789 of file DynaServoGeneric.cxx.
References CfgWriteRotationLimits(), DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, and DynaServo::m_comm.
Referenced by CvtRawVoltToVolts().
|
virtual |
Write to the servo configuration EEPROM to set the servo operational mode to the full/continuous mode.
If this servo is the master in a linked pair of servos, both servos' configuration data are written.
Implements DynaServo.
Definition at line 797 of file DynaServoGeneric.cxx.
References CfgWriteRotationLimits(), DYNA_CCW_POS_CONT_MODE, DYNA_CW_POS_CONT_MODE, DYNA_MODE_CONTINUOUS, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_MODE, and DynaServo::m_comm.
Referenced by CvtRawVoltToVolts().
|
virtual |
Write to the servo configuration EEPROM the new maximum temperature limit.
uTempLim | Temperature limit. |
Implements DynaServo.
Definition at line 491 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_TEMP_MAX, DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServoCfg_T::m_uLimTemp, DynaServoSpec_T::m_uRawTempMax, DynaServoSpec_T::m_uRawTempMin, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CvtRawVoltToVolts().
|
virtual |
Write to the servo configuration EEPROM the new voltage limits.
If this servo is the master in a linked pair of servos, both servos' configuration data are written.
uMinVoltLim | Minimum voltage limit. |
uMaxVoltLim | Maximum voltage limit. |
Implements DynaServo.
Definition at line 564 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_VOLT_MAX, DYNA_ADDR_LIM_VOLT_MIN, DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServoCfg_T::m_uLimVoltMax, DynaServoCfg_T::m_uLimVoltMin, DynaServoSpec_T::m_uRawVoltMax, DynaServoSpec_T::m_uRawVoltMin, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CvtRawVoltToVolts().
|
protectedvirtual |
Check data for consitencies.
Definition at line 1720 of file DynaServoGeneric.cxx.
Referenced by CvtRawVoltToVolts(), DynaServoAX12::DynaServoAX12(), DynaServoEX106P::DynaServoEX106P(), DynaServoGeneric(), DynaServoMX106::DynaServoMX106(), DynaServoMX12W::DynaServoMX12W(), DynaServoMX28::DynaServoMX28(), DynaServoMX64::DynaServoMX64(), DynaServoRX10::DynaServoRX10(), DynaServoRX24F::DynaServoRX24F(), DynaServoRX28::DynaServoRX28(), DynaServoRX64::DynaServoRX64(), and Reset().
|
protectedvirtual |
Check validity of compliance slope discrete values.
uVal | Slope value. |
Definition at line 2074 of file DynaServoGeneric.cxx.
References DYNA_COMP_SLOPE_TORQUE_1, DYNA_COMP_SLOPE_TORQUE_2, DYNA_COMP_SLOPE_TORQUE_3, DYNA_COMP_SLOPE_TORQUE_4, DYNA_COMP_SLOPE_TORQUE_5, DYNA_COMP_SLOPE_TORQUE_6, and DYNA_COMP_SLOPE_TORQUE_7.
Referenced by CalcMatesGoalSpeed(), and WriteCtlMethodCompliance().
|
inlinevirtual |
Convert raw temperature coding to degrees Celsius.
uTemp | Raw temperature value. |
Implements DynaServo.
Definition at line 127 of file DynaServoGeneric.h.
|
inlinevirtual |
Convert raw volts coding to volts.
uTemp | Raw volts value. |
Implements DynaServo.
Definition at line 139 of file DynaServoGeneric.h.
References AgentWriteGoalPos(), AgentWriteGoalSpeed(), AgentWriteGoalSpeedPos(), CalcMatesGoalPos(), CfgReadAlarmShutdownMask(), CfgReadMaxTorqueLimit(), CfgReadRotationLimits(), CfgReadServoMode(), CfgReadTemperatureLimit(), CfgReadVoltageLimits(), CfgWriteAlarmShutdownMask(), CfgWriteMaxTorqueLimit(), CfgWriteRotationLimits(), CfgWriteServoMode(), CfgWriteServoModeContinuous(), CfgWriteTemperatureLimit(), CfgWriteVoltageLimits(), CheckData(), Dump(), EStop(), Freeze(), Init(), InitCfg(), InitSpec(), InitState(), MoveAtSpeed(), MoveAtSpeedTo(), MoveTo(), Ping(), Read(), ReadControlMethod(), ReadCurLoad(), ReadCurPos(), ReadCurSpeed(), ReadDynamics(), ReadGoalPos(), ReadGoalSpeed(), ReadHealth(), ReadIsMoving(), ReadLed(), ReadMaxTorqueLimit(), ReadTorqueEnable(), Release(), ReloadMaxTorqueLimit(), Reset(), SetServoMode(), Stop(), SyncCfg(), SyncData(), SyncState(), Write(), WriteControlMethod(), WriteGoalPos(), WriteGoalSpeed(), WriteLed(), WriteMaxTorqueLimit(), and WriteTorqueEnable().
|
virtual |
Emergency stop servo.
All torque is removed.
If this servo is the master in a linked pair of servos, both servos will be emergency stopped.
Implements DynaServo.
Definition at line 264 of file DynaServoGeneric.cxx.
References DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::m_comm, Stop(), and WriteTorqueEnable().
Referenced by CvtRawVoltToVolts().
|
virtual |
Freeze servo at current position.
Torque is applied.
If this servo is the master in a linked pair of servos, both servos will be frozen.
Implements DynaServo.
Definition at line 326 of file DynaServoGeneric.cxx.
References DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::m_comm, Stop(), and WriteTorqueEnable().
Referenced by CvtRawVoltToVolts().
|
virtual |
Move at speed.
Speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify goal rotation in the clockwise direction, stop, or goal rotation in the counterclockwise direction, respectively.
If this servo is the master in a linked pair of servos, both servos will move synchronously.
nGoalSpeed | Goal speed (raw). |
Implements DynaServo.
Definition at line 255 of file DynaServoGeneric.cxx.
References DYNA_MODE_CONTINUOUS, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_IN_MODE, DynaServo::m_comm, and WriteGoalSpeed().
Referenced by CvtRawVoltToVolts().
|
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 goal rotation in the clockwise direction, stop, or goal 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. The absolute value of the goal speed is used.
If the servo is in continuous mode, but supports 360 ° positioning data, 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.
nGoalSpeed | Goal speed (raw). |
nGoalOdPos | Goal position (odometer ticks). |
Implements DynaServo.
Definition at line 235 of file DynaServoGeneric.cxx.
References AgentWriteGoalSpeedPos(), DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_POS_CTL, DynaServo::HasAgent(), DynaServo::m_comm, WriteGoalPos(), and WriteGoalSpeed().
Referenced by CvtRawVoltToVolts().
|
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.
nGoalOdPos | Goal position (odometer ticks). |
Implements DynaServo.
Definition at line 215 of file DynaServoGeneric.cxx.
References AgentWriteGoalPos(), DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DYNA_TRY_SERVO_HAS_POS_CTL, DynaServo::HasAgent(), DynaServo::m_comm, and WriteGoalPos().
Referenced by CvtRawVoltToVolts().
|
protectedvirtual |
Pack the goal speed into the control table value.
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.
nGoalSpeed | Goal speed. |
Implements DynaServo.
Definition at line 2091 of file DynaServoGeneric.cxx.
References DYNA_GOAL_SPEED_DIR_CCW, DYNA_GOAL_SPEED_DIR_CW, DYNA_GOAL_SPEED_MAG_MASK, DYNA_MODE_CONTINUOUS, iabs(), DynaServo::m_cfg, and DynaServoCfg_T::m_uServoMode.
Referenced by CalcMatesGoalSpeed(), and WriteGoalSpeed().
|
virtual |
Ping this servo.
Implements DynaServo.
Definition at line 1493 of file DynaServoGeneric.cxx.
References DYNA_TRY_COMM, DynaServo::m_comm, DynaServo::m_nServoId, and DynaComm::Ping().
Referenced by CvtRawVoltToVolts().
|
virtual |
Read a raw value from the servo EEPROM/RAM control table.
uAddr | Control table address. | |
[out] | pVal | Read raw value. |
doc_return_std
Implements DynaServo.
Reimplemented in DynaServoEX106P.
Definition at line 1401 of file DynaServoGeneric.cxx.
References DYNA_ADDR_ALARM_LED, DYNA_ADDR_ALARM_SHUTDOWN, DYNA_ADDR_BAUD_RATE, DYNA_ADDR_CCW_COMP_MARGIN, DYNA_ADDR_CCW_COMP_SLOPE, DYNA_ADDR_CUR_LOAD_LSB, DYNA_ADDR_CUR_POS_LSB, DYNA_ADDR_CUR_SPEED_LSB, DYNA_ADDR_CUR_TEMP_C, DYNA_ADDR_CUR_VOLT, DYNA_ADDR_CW_COMP_MARGIN, DYNA_ADDR_CW_COMP_SLOPE, DYNA_ADDR_EEPROM_LOCK, DYNA_ADDR_FWVER, DYNA_ADDR_GOAL_POS_LSB, DYNA_ADDR_GOAL_SPEED_LSB, DYNA_ADDR_ID, DYNA_ADDR_IS_MOVING, DYNA_ADDR_LED, DYNA_ADDR_LIM_CCW_LSB, DYNA_ADDR_LIM_CW_LSB, DYNA_ADDR_LIM_TEMP_MAX, DYNA_ADDR_LIM_TORQUE_MAX_LSB, DYNA_ADDR_LIM_TORQUE_MAX_ON_LSB, DYNA_ADDR_LIM_VOLT_MAX, DYNA_ADDR_LIM_VOLT_MIN, DYNA_ADDR_MODEL_NUM_LSB, DYNA_ADDR_PUNCH_LSB, DYNA_ADDR_REG_INSTR, DYNA_ADDR_SRL, DYNA_ADDR_T_RET_DELAY, DYNA_ADDR_TORQUE_EN, DYNA_TRY_ADDR, DYNA_TRY_COMM, DynaServo::m_comm, DynaServo::m_nServoId, DynaComm::Read16(), and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and DynaServoEX106P::Read().
|
virtual |
Read from the servo state memory the current control method parameters.
The control method used is determined by the servo's specification.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pCtlMethod | Control method parameters. |
Implements DynaServo.
Definition at line 940 of file DynaServoGeneric.cxx.
References DYNA_CTL_METHOD_COMPLIANCE, DYNA_CTL_METHOD_PID, DYNA_ECODE_INTERNAL, DYNA_LOG_ERROR, DYNA_TRY_COMM, DynaServo::m_comm, DynaServo::m_nServoId, DynaServo::m_spec, DynaServoSpec_T::m_uCtlMethodUsed, ReadCtlMethodCompliance(), and ReadCtlMethodPid().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
protectedvirtual |
Read from the servo state memory the current compliance control method parameters.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pCtlMethod | Control method parameters. |
Definition at line 1773 of file DynaServoGeneric.cxx.
References DYNA_ADDR_CCW_COMP_MARGIN, DYNA_ADDR_CCW_COMP_SLOPE, DYNA_ADDR_CW_COMP_MARGIN, DYNA_ADDR_CW_COMP_SLOPE, DYNA_CTL_METHOD_COMPLIANCE, DYNA_OK, DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServoCtlMethod_T::m_comp, DynaServoState_T::m_ctlMethod, DynaServo::m_link, DynaServo::m_nServoId, DynaServoCtlMethod_T::m_params, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaServoCtlMethod_T::m_uCtlMethod, and DynaComm::Read8().
Referenced by CalcMatesGoalSpeed(), and ReadControlMethod().
|
protectedvirtual |
Read from the servo state memory the current PID control method parameters.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pCtlMethod | Control method parameters. |
Definition at line 1939 of file DynaServoGeneric.cxx.
References DYNA_ADDR_D_GAIN, DYNA_ADDR_I_GAIN, DYNA_ADDR_P_GAIN, DYNA_CTL_METHOD_PID, DYNA_OK, DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServoState_T::m_ctlMethod, DynaServo::m_link, DynaServo::m_nServoId, DynaServoCtlMethod_T::m_params, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaServoCtlMethod_T::m_uCtlMethod, and DynaComm::Read8().
Referenced by CalcMatesGoalSpeed(), and ReadControlMethod().
|
virtual |
Read from the servo state memory the current load.
Loads are in the range [-max,max] where the values < 0, 0, and > 0 specify torques loads in clockwise direction, no torque load, or torque loads in the counterclockwise direction, respectively. Load is approximately 0.1% of maximum.
[out] | pCurLoad | Current load. |
Implements DynaServo.
Definition at line 1275 of file DynaServoGeneric.cxx.
References DYNA_ADDR_CUR_LOAD_LSB, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServoState_T::m_nCurLoad, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaComm::Read16(), and UnpackCurLoad().
Referenced by CvtRawVoltToVolts(), ReadDynamics(), and ReadHealth().
|
virtual |
Read from the servo state memory the current servo position.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pCurOdPos | Odometer current position (ticks). |
Implements DynaServo.
Definition at line 1222 of file DynaServoGeneric.cxx.
References DYNA_ADDR_CUR_POS_LSB, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_SERVO_HAS_POS_CTL, DynaServo::GetOdometer(), DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaServoState_T::m_uCurPos, DynaComm::Read16(), and DynaServo::UpdateOdometer().
Referenced by CalcMatesGoalPos(), CvtRawVoltToVolts(), ReadDynamics(), Stop(), and SyncState().
|
virtual |
Read from the servo state memory the current speed and direction.
Speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify the servo is rotating in the clockwise direction, the servo is stopped, or the servo is rotating in the counterclockwise direction, respectively.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pCurSpeed | Current speed. |
Implements DynaServo.
Definition at line 1250 of file DynaServoGeneric.cxx.
References DYNA_ADDR_CUR_SPEED_LSB, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServoState_T::m_nCurSpeed, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaComm::Read16(), and UnpackCurSpeed().
Referenced by CvtRawVoltToVolts(), ReadDynamics(), and SyncState().
|
virtual |
Read from the servo state memory the current servo dynamics.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pCurPos | Current position. |
[out] | pCurSpeed | Current speed. |
[out] | pCurLoad | Current load. |
Implements DynaServo.
Definition at line 1299 of file DynaServoGeneric.cxx.
References DYNA_OK, DYNA_TRY_COMM, DynaServo::m_comm, ReadCurLoad(), ReadCurPos(), and ReadCurSpeed().
Referenced by CvtRawVoltToVolts().
|
virtual |
Read from the servo state memory the current goal position.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pGoalPos | Servo Mode: Encoder goal position. Continuous Mode: Odometer goal position. |
Implements DynaServo.
Definition at line 981 of file DynaServoGeneric.cxx.
References DYNA_ADDR_GOAL_POS_LSB, DYNA_MODE_CONTINUOUS, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServoOdometer_T::m_nOdGoalPos, DynaServo::m_nServoId, DynaServoState_T::m_od, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaServoState_T::m_uGoalPos, DynaServoCfg_T::m_uServoMode, and DynaComm::Read16().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Read from the servo state memory the current goal speed and direction.
For servos in continuous mode, speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify goal rotation in the clockwise direction, stop, or goal 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' state data are read.
[out] | pGoalSpeed | Goal speed. |
Implements DynaServo.
Definition at line 1072 of file DynaServoGeneric.cxx.
References DYNA_ADDR_GOAL_SPEED_LSB, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServoState_T::m_nGoalSpeed, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaComm::Read16(), and UnpackGoalSpeed().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Read from the servo state memory the current servo health.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pAlarms | Servo alarms. |
[out] | pCurLoad | Current load. |
[out] | pCurVolt | Current voltage. |
[out] | pCurTemp | Current temperature. |
Implements DynaServo.
Definition at line 1326 of file DynaServoGeneric.cxx.
References DYNA_ADDR_CUR_TEMP_C, DYNA_ADDR_CUR_VOLT, DYNA_OK, DYNA_TRY_COMM, DynaComm::GetAlarms(), DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaServoState_T::m_uAlarms, DynaServoState_T::m_uCurTemp, DynaServoState_T::m_uCurVolt, DynaComm::Read8(), and ReadCurLoad().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Read from the servo state memory to test if the servo is currently moving.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pState | Servo is [not] moving (true/false) state. |
Implements DynaServo.
Definition at line 1376 of file DynaServoGeneric.cxx.
References DYNA_ADDR_IS_MOVING, DYNA_IS_NOT_MOVING, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServoState_T::m_bIsMoving, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Read from the servo state memory the current LED on/off value.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pState | On (true) or off (false) state. |
Implements DynaServo.
Definition at line 873 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LED, DYNA_LED_OFF, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServoState_T::m_bLed, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Read from the servo state memory the current maximum torque limit.
The servo will initially set this value to the value in the RAM Maximum Torque Limit configuration. The servo will set this value to 0 on an alarm shutdown event.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pMaxTorqueLim | Maximum torque limit. |
Implements DynaServo.
Definition at line 1147 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_TORQUE_MAX_LSB, DYNA_OK, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaServoState_T::m_uLimTorqueMax, and DynaComm::Read16().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Read from the servo state memory the current torque enable value.
If this servo is the master in a linked pair of servos, both servos' state data are read.
[out] | pState | Torque enabled (true) or disabled (off) state. |
Implements DynaServo.
Definition at line 806 of file DynaServoGeneric.cxx.
References DYNA_ADDR_TORQUE_EN, DYNA_OK, DYNA_TORQUE_EN_OFF, DYNA_TRY_COMM, DynaServo::IsLinkedMaster(), DynaServoState_T::m_bTorqueEnabled, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), and SyncState().
|
virtual |
Release servo from any applied torque.
Servo is free to rotate.
If this servo is the master in a linked pair of servos, both servos will be released.
Implements DynaServo.
Definition at line 346 of file DynaServoGeneric.cxx.
References DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::m_comm, Stop(), and WriteTorqueEnable().
Referenced by CvtRawVoltToVolts().
|
virtual |
Reload the maximum torque limit from the configuration.
If this servo is the master in a linked pair of servos, both servos' state data are reloaded.
Implements DynaServo.
Definition at line 1214 of file DynaServoGeneric.cxx.
References DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::m_cfg, DynaServo::m_comm, DynaServoCfg_T::m_uLimTorqueMax, and WriteMaxTorqueLimit().
Referenced by CvtRawVoltToVolts().
|
virtual |
Reset this servo back to default values.
Implements DynaServo.
Definition at line 1499 of file DynaServoGeneric.cxx.
References CheckData(), DYNA_OK, DYNA_TRY_COMM, DynaServo::m_comm, DynaServo::m_nServoId, DynaComm::Reset(), and SyncData().
Referenced by CvtRawVoltToVolts().
|
protected |
Set the servo mode given the servo capabilites and the current rotation limits.
See Dynamixel Operational Modes.
Definition at line 2149 of file DynaServoGeneric.cxx.
References DYNA_CCW_POS_CONT_MODE, DYNA_CW_POS_CONT_MODE, DYNA_MODE_CONTINUOUS, DYNA_MODE_SERVO, DynaServo::m_cfg, DynaServo::m_spec, DynaServoCfg_T::m_uLimCcw, DynaServoCfg_T::m_uLimCw, DynaServoCfg_T::m_uServoMode, and DynaServoSpec_T::m_uSupportedModes.
Referenced by CfgReadRotationLimits(), CfgWriteRotationLimits(), and CvtRawVoltToVolts().
|
virtual |
Stop servo.
Current torque levels are kept.
If this servo is the master in a linked pair of servos, both servos will be stopped.
Implements DynaServo.
Definition at line 285 of file DynaServoGeneric.cxx.
References AgentWriteGoalSpeed(), DYNA_MODE_CONTINUOUS, DYNA_MODE_SERVO, DYNA_OK, DYNA_SPEED_CONT_STOP, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::GetServoMode(), DynaServo::HasAgent(), DynaServo::m_comm, ReadCurPos(), WriteGoalPos(), and WriteGoalSpeed().
Referenced by CvtRawVoltToVolts(), EStop(), Freeze(), and Release().
|
virtual |
Synchronize the shadowed configuration to the servo control table EEPROM configuration.
Implements DynaServo.
Reimplemented in DynaServoEX106P.
Definition at line 1522 of file DynaServoGeneric.cxx.
References CfgReadAlarmShutdownMask(), CfgReadMaxTorqueLimit(), CfgReadRotationLimits(), CfgReadTemperatureLimit(), CfgReadVoltageLimits(), DYNA_ADDR_ALARM_LED, DYNA_ADDR_SRL, DYNA_ADDR_T_RET_DELAY, DYNA_OK, DYNA_TRY_COMM, DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_nServoId, DynaServoCfg_T::m_uAlarmLed, DynaServoCfg_T::m_uSrl, DynaServoCfg_T::m_uTRetDelay, and DynaComm::Read8().
Referenced by CvtRawVoltToVolts(), DynaServoEX106P::SyncCfg(), and SyncData().
|
virtual |
Synchronize the shadowed configuration and state data to the servo control table.
Implements DynaServo.
Definition at line 1512 of file DynaServoGeneric.cxx.
References SyncCfg(), and SyncState().
Referenced by CvtRawVoltToVolts(), DynaServoAX12::DynaServoAX12(), DynaServoEX106P::DynaServoEX106P(), DynaServoGeneric(), DynaServoMX106::DynaServoMX106(), DynaServoMX12W::DynaServoMX12W(), DynaServoMX28::DynaServoMX28(), DynaServoMX64::DynaServoMX64(), DynaServoRX10::DynaServoRX10(), DynaServoRX24F::DynaServoRX24F(), DynaServoRX28::DynaServoRX28(), DynaServoRX64::DynaServoRX64(), and Reset().
|
virtual |
Synchronize the shadowed state data to the servo control table RAM state.
Implements DynaServo.
Reimplemented in DynaServoEX106P.
Definition at line 1554 of file DynaServoGeneric.cxx.
References DYNA_LOG_SERVO_ALARMS, DYNA_OK, DYNA_TRY_COMM, DynaServo::m_comm, DynaServoState_T::m_ctlMethod, DynaServo::m_nServoId, DynaServo::m_state, DynaServoState_T::m_uAlarms, ReadControlMethod(), ReadCurPos(), ReadCurSpeed(), ReadGoalPos(), ReadGoalSpeed(), ReadHealth(), ReadIsMoving(), ReadLed(), ReadMaxTorqueLimit(), ReadTorqueEnable(), and DynaServo::ResetOdometer().
Referenced by CvtRawVoltToVolts(), SyncData(), and DynaServoEX106P::SyncState().
|
protectedvirtual |
Unpack current load estimate from the control table value.
Loads are in the range [-max,max] where the values < 0, 0, and > 0 specify torques loads in clockwise direction, no torque load, or torque loads in the counterclockwise direction, respectively.
uVal | Packed field. |
Implements DynaServo.
Definition at line 2135 of file DynaServoGeneric.cxx.
References DYNA_CUR_LOAD_DIR_CW, DYNA_CUR_LOAD_DIR_MASK, and DYNA_CUR_LOAD_MAG_MASK.
Referenced by CalcMatesGoalSpeed(), and ReadCurLoad().
|
protectedvirtual |
Unpack current speed from the control table value.
Speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify the servo is rotating in the clockwise direction, the servo is stopped, or the servo is rotating in the counterclockwise direction, respectively.
uVal | Packed field. |
Implements DynaServo.
Definition at line 2121 of file DynaServoGeneric.cxx.
References DYNA_CUR_SPEED_DIR_CW, DYNA_CUR_SPEED_DIR_MASK, and DYNA_CUR_SPEED_MAG_MASK.
Referenced by CalcMatesGoalSpeed(), and ReadCurSpeed().
|
protectedvirtual |
Unpack goal speed from the control table value.
For servos in continuous mode, speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify the servo is rotating in the clockwise direction, the servo is stopped, or the servo is rotating 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.
uVal | Packed field. |
Implements DynaServo.
Definition at line 2104 of file DynaServoGeneric.cxx.
References DYNA_GOAL_SPEED_DIR_CW, DYNA_GOAL_SPEED_DIR_MASK, DYNA_GOAL_SPEED_MAG_MASK, DYNA_MODE_CONTINUOUS, DynaServo::m_cfg, and DynaServoCfg_T::m_uServoMode.
Referenced by CalcMatesGoalSpeed(), and ReadGoalSpeed().
|
virtual |
Write a raw value to the servo EEPROM/RAM control table.
uAddr | Control table address. |
uVal | Raw value to write. |
doc_return_std
Implements DynaServo.
Reimplemented in DynaServoEX106P.
Definition at line 1447 of file DynaServoGeneric.cxx.
References DYNA_ADDR_ALARM_LED, DYNA_ADDR_ALARM_SHUTDOWN, DYNA_ADDR_BAUD_RATE, DYNA_ADDR_CCW_COMP_MARGIN, DYNA_ADDR_CCW_COMP_SLOPE, DYNA_ADDR_CUR_LOAD_LSB, DYNA_ADDR_CUR_POS_LSB, DYNA_ADDR_CUR_SPEED_LSB, DYNA_ADDR_CUR_TEMP_C, DYNA_ADDR_CUR_VOLT, DYNA_ADDR_CW_COMP_MARGIN, DYNA_ADDR_CW_COMP_SLOPE, DYNA_ADDR_EEPROM_LOCK, DYNA_ADDR_FWVER, DYNA_ADDR_GOAL_POS_LSB, DYNA_ADDR_GOAL_SPEED_LSB, DYNA_ADDR_ID, DYNA_ADDR_IS_MOVING, DYNA_ADDR_LED, DYNA_ADDR_LIM_CCW_LSB, DYNA_ADDR_LIM_CW_LSB, DYNA_ADDR_LIM_TEMP_MAX, DYNA_ADDR_LIM_TORQUE_MAX_LSB, DYNA_ADDR_LIM_TORQUE_MAX_ON_LSB, DYNA_ADDR_LIM_VOLT_MAX, DYNA_ADDR_LIM_VOLT_MIN, DYNA_ADDR_MODEL_NUM_LSB, DYNA_ADDR_PUNCH_LSB, DYNA_ADDR_REG_INSTR, DYNA_ADDR_SRL, DYNA_ADDR_T_RET_DELAY, DYNA_ADDR_TORQUE_EN, DYNA_TRY_ADDR, DYNA_TRY_COMM, DynaServo::m_comm, DynaServo::m_nServoId, DynaComm::Write16(), and DynaComm::Write8().
Referenced by CvtRawVoltToVolts(), and DynaServoEX106P::Write().
|
virtual |
Write to the servo state memory the new control method parameters.
The control method used is determined by the servo's specification.
If this servo is the master in a linked pair of servos, both servos' state data are written.
ctlMethod | Control method parameters. |
Implements DynaServo.
Definition at line 960 of file DynaServoGeneric.cxx.
References DYNA_CTL_METHOD_COMPLIANCE, DYNA_CTL_METHOD_PID, DYNA_ECODE_INTERNAL, DYNA_LOG_ERROR, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::m_comm, DynaServo::m_nServoId, DynaServo::m_spec, DynaServoSpec_T::m_uCtlMethodUsed, WriteCtlMethodCompliance(), and WriteCtlMethodPid().
Referenced by CvtRawVoltToVolts().
|
protectedvirtual |
Write to the servo state memory the new compliance control method parameters.
If this servo is the master in a linked pair of servos, both servos' state data are written.
ctlMethod | Control method parameters. |
Definition at line 1814 of file DynaServoGeneric.cxx.
References ChkComplianceSlope(), DYNA_ADDR_CCW_COMP_MARGIN, DYNA_ADDR_CCW_COMP_SLOPE, DYNA_ADDR_CW_COMP_MARGIN, DYNA_ADDR_CW_COMP_SLOPE, DYNA_COMP_MARGIN_MAX_RAW, DYNA_COMP_MARGIN_MIN_RAW, DYNA_ECODE_BAD_VAL, DYNA_ECODE_NOT_SUPP, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServoCtlMethod_T::m_comp, DynaServoState_T::m_ctlMethod, DynaServo::m_link, DynaServo::m_nServoId, DynaServoCtlMethod_T::m_params, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServo::m_state, DynaServoCtlMethod_T::m_uCtlMethod, DynaServoSpec_T::m_uCtlMethodUsed, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CalcMatesGoalSpeed(), and WriteControlMethod().
|
protectedvirtual |
Write to the servo state memory the new PID control method parameters.
If this servo is the master in a linked pair of servos, both servos' state data are written.
ctlMethod | Control method parameters. |
Definition at line 1974 of file DynaServoGeneric.cxx.
References DYNA_ADDR_D_GAIN, DYNA_ADDR_I_GAIN, DYNA_ADDR_P_GAIN, DYNA_D_GAIN_MAX_RAW, DYNA_D_GAIN_MIN_RAW, DYNA_ECODE_BAD_VAL, DYNA_ECODE_NOT_SUPP, DYNA_I_GAIN_MAX_RAW, DYNA_I_GAIN_MIN_RAW, DYNA_OK, DYNA_P_GAIN_MAX_RAW, DYNA_P_GAIN_MIN_RAW, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServoState_T::m_ctlMethod, DynaServo::m_link, DynaServo::m_nServoId, DynaServoCtlMethod_T::m_params, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServo::m_state, DynaServoCtlMethod_T::m_uCtlMethod, DynaServoSpec_T::m_uCtlMethodUsed, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CalcMatesGoalSpeed(), and WriteControlMethod().
|
virtual |
Write to the servo state memory to set the new goal position.
If the servo [pair] are in servo mode, rotation will occur until the position(s) are achieved.
If this servo is the master in a linked pair of servos, both servos' state written.
nGoalOdPos | Odometer goal position (odometer ticks). In continuous mode, writing the goal position has no effect on movement. |
Implements DynaServo.
Definition at line 1013 of file DynaServoGeneric.cxx.
References CalcMatesGoalPos(), DYNA_ADDR_GOAL_POS_LSB, DYNA_ECODE_BAD_VAL, DYNA_MODE_SERVO, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_cfg, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServo::m_state, DynaServoState_T::m_uGoalPos, DynaServoSpec_T::m_uRawPosMax, DynaServoSpec_T::m_uRawPosMin, DynaServoCfg_T::m_uServoMode, DynaServo::OdometerToEncoder(), DynaComm::vSyncWrite(), and DynaComm::Write16().
Referenced by CvtRawVoltToVolts(), MoveAtSpeedTo(), MoveTo(), and Stop().
|
virtual |
Write to the servo state memory the new goal speed and direction.
For servos in continuous mode, speeds are in the range [-max,max] where the values < 0, 0, and > 0 specify goal rotation in the clockwise direction, stop, or goal 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, rotation will occur indefinitely in the direction specified and at the given speed.
nGoalSpeed | Goal speed. |
Implements DynaServo.
Definition at line 1096 of file DynaServoGeneric.cxx.
References CalcMatesGoalSpeed(), DYNA_ADDR_GOAL_SPEED_LSB, DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_SPEED_MAX_RAW, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), iabs(), DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServoState_T::m_nGoalSpeed, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, PackGoalSpeed(), DynaComm::vSyncWrite(), and DynaComm::Write16().
Referenced by CvtRawVoltToVolts(), MoveAtSpeed(), MoveAtSpeedTo(), and Stop().
|
virtual |
Write to the servo state memory to turn on or off the servo LED.
If this servo is the master in a linked pair of servos, both servos' state written.
bState | On (true) or off (false) state. |
Implements DynaServo.
Definition at line 898 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LED, DYNA_LED_OFF, DYNA_LED_ON, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServoState_T::m_bLed, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CvtRawVoltToVolts().
|
virtual |
Write to the servo state memory to set the new maximum torque limit.
If this servo is the master in a linked pair of servos, both servos' state written.
uMaxTorqueLim | Maximum torque limit. |
Implements DynaServo.
Definition at line 1169 of file DynaServoGeneric.cxx.
References DYNA_ADDR_LIM_TORQUE_MAX_LSB, DYNA_ECODE_BAD_VAL, DYNA_OK, DYNA_TRY_COMM, DYNA_TRY_EXPR, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_spec, DynaServo::m_state, DynaServoState_T::m_uLimTorqueMax, DynaServoSpec_T::m_uRawTorqueMax, DynaServoSpec_T::m_uRawTorqueMin, DynaComm::vSyncWrite(), and DynaComm::Write16().
Referenced by CvtRawVoltToVolts(), and ReloadMaxTorqueLimit().
|
virtual |
Write to the servo state memory to set the new torque enable value.
If the torque state is false (off), no power is applied to the servo, allowing it to be free rotated by any external force.
If this servo is the master in a linked pair of servos, both servos' state written.
bState | Torque enabled (true) or disabled (off) state. |
Implements DynaServo.
Definition at line 831 of file DynaServoGeneric.cxx.
References DYNA_ADDR_TORQUE_EN, DYNA_OK, DYNA_TORQUE_EN_OFF, DYNA_TORQUE_EN_ON, DYNA_TRY_COMM, DYNA_TRY_IS_MASTER, DynaServo::GetServoId(), DynaServo::IsLinkedMaster(), DynaServoState_T::m_bTorqueEnabled, DynaServo::m_comm, DynaServo::m_link, DynaServo::m_nServoId, DynaServo::CrossLink_T::m_pServoMate, DynaServo::m_state, DynaComm::vSyncWrite(), and DynaComm::Write8().
Referenced by CvtRawVoltToVolts(), EStop(), Freeze(), and Release().
|
static |