Dynamixel  2.9.5
RoadNarrows Robotics Dynamixel Package
DynaShellCmdClearAlarms Class Reference

Determine if servos are moving. More...

Inheritance diagram for DynaShellCmdClearAlarms:
DynaShellCmdChainIn DynaShellCmd

Protected Member Functions

virtual void doExec (DynaShell &shell, DynaServo *pServo)
 Determine if servo is moving. More...
 
- Protected Member Functions inherited from DynaShellCmd
virtual void PrintSynopses (int indent, int width)
 Print synsopses. More...
 
virtual void PrintBlock (int col, int indent, int width, const char *sText)
 Print a block of indented text of width. More...
 
virtual void PrintDelim (int width, const char cDelim)
 
char * eow (const char *s)
 Find end of word. More...
 

Additional Inherited Members

- Public Member Functions inherited from DynaShellCmdChainIn
 DynaShellCmdChainIn (bool bMasterOpOnly=false)
 Default constructor.
 
virtual ~DynaShellCmdChainIn ()
 Default destructor.
 
virtual void Exec (DynaShell &shell, int argc, char *argv[])
 Execute 'read-like' command on servos. More...
 
virtual char * TabCompletion (DynaShell &shell, const char *sText, size_t uTextLen, int nState, const char *sContext)
 Command tab completion generator. More...
 
- Public Member Functions inherited from DynaShellCmd
 DynaShellCmd (int nArgCntMin=0, int nArgCntMax=0)
 Default constructor.
 
virtual ~DynaShellCmd ()
 Default destructor.
 
const char * GetCmdName ()
 Get dynamixel shell command name. More...
 
const char * GetCmdHelpBrief ()
 Get shell command name brief description. More...
 
virtual void PrintHelp (int indent=0, int width=80)
 Print command help with the description aligned at the given indentation. More...
 
int GetPublishedLevel () const
 
const char * GetPublishedName () const
 
int SetPublishedInfo (int nLevel, const char *sParent=NULL)
 
virtual bool ChkArgCnt (DynaShell &shell, int argc)
 Check that the argument count is within the class (min,max). More...
 
bool ChkArgCnt0 (DynaShell &shell, int argc)
 Check that the argument count is zero. More...
 
bool ChkArgCntEQ (DynaShell &shell, int argc, int eq)
 Check that the argument count is equal to the required. More...
 
bool ChkArgCntGE (DynaShell &shell, int argc, int min)
 Check argument count against minimum required. More...
 
bool ChkArgCntLE (DynaShell &shell, int argc, int max)
 Check argument count against maximum allowed. More...
 
bool ChkComm (DynaShell &shell)
 Check that Dynamixel communication exists and is open. More...
 
bool ChkChain (DynaShell &shell)
 Check that the servo chain exists. More...
 
bool ChkChainNotEmpty (DynaShell &shell)
 Check that the servo chain exists and is not empty. More...
 
bool ChkChainHasServo (DynaShell &shell, int nServoId)
 Check that the given servo is present in the chain. More...
 
bool ChkChainIsMasterServo (DynaShell &shell, int nServoId)
 Check that the given servo is a master. More...
 
bool ToInt (DynaShell &shell, const char *sArg, int *pVal)
 Convert command argument to integer. More...
 
bool ToUInt (DynaShell &shell, const char *sArg, uint_t *pVal)
 Convert command argument to unsigned integer. More...
 
bool ToDouble (DynaShell &shell, const char *sArg, double *pVal)
 Convert command argument to double. More...
 
bool ToBool (DynaShell &shell, const char *sArg, bool *pVal)
 Convert command argument to boolean. More...
 
- Protected Attributes inherited from DynaShellCmdChainIn
bool m_bMasterOpOnly
 is [not] a master-only supported operation
 
int m_nTabIter
 tab completion: servo id iterator
 
int m_nTabServoId
 tab completion: current servo id
 
bool m_bTabIncChain
 tab completion: [do not] include chain keyword
 
- Protected Attributes inherited from DynaShellCmd
const char * m_sCmdName
 command name
 
const char * m_sCmdHelpBrief
 command help brief
 
const char * m_sCmdHelpArgs
 command help arguments
 
const char * m_sCmdHelpDesc
 command help description
 
const int m_nArgCntMin
 minimum argument count
 
const int m_nArgCntMax
 maximum argument count (0 if not max)
 
int m_nPubLevel
 command's published level (depth)
 
char * m_sPubName
 command's published name
 

Detailed Description

Determine if servos are moving.

Definition at line 2121 of file dynashell_cmd_servo.cxx.

Member Function Documentation

virtual void DynaShellCmdClearAlarms::doExec ( DynaShell shell,
DynaServo pServo 
)
inlineprotectedvirtual

Determine if servo is moving.

Parameters
shellDynamixel shell.
pServoPointer to servo.

Implements DynaShellCmdChainIn.

Definition at line 2152 of file dynashell_cmd_servo.cxx.

References DYNA_ALARM_LOAD, DYNA_ALARM_NONE, DYNA_OK, DynaShell::Error(), DynaServo::GetAlarms(), DynaServo::GetServoId(), and DynaShell::Response().

2153  {
2154  uint_t uAlarms;
2155  int rc;
2156 
2157  uAlarms = pServo->GetAlarms();
2158 
2159  if( uAlarms == DYNA_ALARM_NONE )
2160  {
2161  shell.Response("Servo %3d: %s.\n", pServo->GetServoId(), "No alarms");
2162  }
2163  else if( uAlarms & DYNA_ALARM_LOAD )
2164  {
2165  pServo->Stop();
2166  rc = pServo->ReloadMaxTorqueLimit();
2167  if( rc != DYNA_OK )
2168  {
2169  shell.Error(rc, "Servo %3d: Failed to reload maximum torque limit.",
2170  pServo->GetServoId());
2171  }
2172  else if( uAlarms == DYNA_ALARM_LOAD )
2173  {
2174  shell.Response("Servo %3d: %s.\n", pServo->GetServoId(),
2175  "Over-load alarm cleared");
2176  }
2177  else
2178  {
2179  shell.Response("Servo %3d: %s.\n", pServo->GetServoId(),
2180  "Over-load alarm cleared, but other unclearable alarms are present");
2181  }
2182  }
2183  else
2184  {
2185  shell.Response("Servo %3d: %s.\n", pServo->GetServoId(),
2186  "Alarms present, but not clearable");
2187  }
2188  }
#define DYNA_OK
not an error, success
Definition: Dynamixel.h:78
#define DYNA_ALARM_LOAD
operating load (torque) out of rnge
Definition: Dynamixel.h:652
#define DYNA_ALARM_NONE
no alarms
Definition: Dynamixel.h:646
void Response(const char *sFmt,...)
Print formatted success response.
Definition: dynashell.cxx:763
virtual uint_t GetAlarms() const
Get the current servo alarms.
Definition: DynaServo.h:435
virtual uint_t GetServoId() const
Get servo id.
Definition: DynaServo.h:155
void Error(int rc, const char *sFmt,...)
Raise error on dynamixel error code.
Definition: dynashell.cxx:808

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