![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
Dynamixel chain output command abstract base class. More...
#include <dynashell_cmd.h>
Public Member Functions | |
DynaShellCmdChainOut (bool bMasterOpOnly=false) | |
Default constructor. | |
virtual | ~DynaShellCmdChainOut () |
Default destructor. | |
virtual void | Exec (DynaShell &shell, int argc, char *argv[]) |
Execute 'write-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... | |
![]() | |
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 Member Functions | |
virtual void | doExec (DynaShell &shell, ExecTup_T tup[], uint_t uCount)=0 |
Derived class specific execution function. More... | |
virtual bool | ArgToUInt (DynaShell &shell, const char *sArg, uint_t *pVal) |
Convert command argument into unsigned integer. More... | |
virtual bool | ArgToInt (DynaShell &shell, const char *sArg, int *pVal) |
![]() | |
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... | |
Protected Attributes | |
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 | |
![]() | |
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 | |
Dynamixel chain output command abstract base class.
This class supports parsing a 2-tuple list of (master) servos as arguments to a derived command class executinng servo 'write-like' output operations. Output operations include write, move, and set.
* CMD args * args ::= * 'chain' value * | tuple_list * tuple_list ::= * tuple * | tuple_list tuple * tuple ::= * servo_id value * servo_id ::= INT * value ::= VAL_TO_UINT *
Definition at line 654 of file dynashell_cmd.h.
|
inlineprotectedvirtual |
Convert command argument into unsigned integer.
shell | Dynamixel shell. | |
sArg | String argument to convert. | |
[out] | pVal | Converted argument. |
Definition at line 703 of file dynashell_cmd.h.
References PublishShellCoreCommands(), PublishShellInterfaceCommands(), PublishShellServoCommands(), and PublishShellTrainCommands().
|
protectedpure virtual |
Derived class specific execution function.
shell | Dynamixel shell. |
tup | Array of (servo id, value) 2-tuples. |
uCount | Number of tuples. |
Implemented in DynaShellCmdWriteGoalSpeed, DynaShellCmdWriteTorqueEnable, DynaShellCmdCfgWriteServoMode, and DynaShellCmdMoveTo.
|
virtual |
Execute 'write-like' command on servos.
shell | Dynamixel shell. |
argc | Command argument count. |
argv | Array of arguments. |
Implements DynaShellCmd.
Definition at line 450 of file dynashell_cmd.cxx.
References DYNA_ID_NONE, DYNA_ID_NUMOF, DynaShell::Error(), DynaChain::IterNext(), DynaChain::IterNextMaster(), DynaChain::IterStart(), DynaChain::IterStartMaster(), ExecTup_T::m_nServoId, ExecTup_T::m_nVal, DynaShell::m_pDynaChain, and TRY.
|
virtual |
Command tab completion generator.
Completes <servo_id> | chain NULL [servo_id NULL [servo_id NULL ...]]
shell | Dynamixel shell. |
sText | Partial text string to complete. |
uTextLen | Length of text. |
nState | Generator state. If FIRST, then initialize any statics. |
sContext | Generator context (i.e. canonical command path). |
Reimplemented from DynaShellCmd.
Definition at line 541 of file dynashell_cmd.cxx.
References ReadLine::dupstr(), DYNA_ID_NONE, ReadLine::FIRST, DynaChain::GetNumberInChain(), DynaChain::GetNumberOfMastersInChain(), DynaChain::IterNext(), DynaChain::IterNextMaster(), DynaChain::IterStart(), DynaChain::IterStartMaster(), DynaShell::m_pDynaChain, and ReadLine::wc().