Dynamixel  2.9.5
RoadNarrows Robotics Dynamixel Package
dynashell_cmd.h File Reference

The dynashell Command Class Interface. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <cstring>
#include <iostream>
#include <fstream>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "Dynamixel/Dynamixel.h"
#include "Dynamixel/DynaComm.h"
#include "Dynamixel/DynaServo.h"
#include "Dynamixel/DynaChain.h"
#include "dynashell.h"

Go to the source code of this file.

Classes

class  DynaShellCmd
 Dynamixel shell command abstract base class. More...
 
class  DynaShellCmdChainIn
 Dynamixel chain input command abstract base class. More...
 
struct  ExecTup_T
 Execute 2-tuple structure type. More...
 
class  DynaShellCmdChainOut
 Dynamixel chain output command abstract base class. More...
 

Macros

#define TRY(boolexpr, ...)   do { if( !(boolexpr) ) { return; } } while(0)
 Try boolean expression. More...
 

Functions

void PublishShellCoreCommands (DynaShell &shell)
 Publish shell core commands to shell. More...
 
void PublishShellInterfaceCommands (DynaShell &shell)
 Publish shell dynamixel interface commands to shell. More...
 
void PublishShellServoCommands (DynaShell &shell)
 Publish shell servo commands to shell. More...
 
void PublishShellTrainCommands (DynaShell &shell)
 Publish shell servo commands to shell. More...
 

Detailed Description

The dynashell Command Class Interface.

LastChangedDate
2015-01-12 10:56:06 -0700 (Mon, 12 Jan 2015)
Rev
3845
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)

Definition in file dynashell_cmd.h.

Macro Definition Documentation

Function Documentation

void PublishShellCoreCommands ( DynaShell shell)

Publish shell core commands to shell.

The core set includes the common shell base commands idependent of application.

shell Dynamixel shell.

Definition at line 689 of file dynashell_cmd_core.cxx.

References DynaShell::PublishCommand().

Referenced by DynaShellCmdChainOut::ArgToUInt(), and MainInit().

690 {
691  shell.PublishCommand(NULL, new DynaShellCmdHelp());
692  shell.PublishCommand(NULL, new DynaShellCmdQuit());
693  //shell.PublishCommand(NULL, new DynaShellCmdExit());
694  shell.PublishCommand(NULL, new DynaShellCmdLog());
695  shell.PublishCommand(NULL, new DynaShellCmdWait());
696  shell.PublishCommand("run", new DynaShellCmdScript());
697 }
void PublishCommand(const char *sParent, DynaShellCmd *pNewCmd)
Publish new command to shell.
Definition: dynashell.cxx:192
void PublishShellInterfaceCommands ( DynaShell shell)

Publish shell dynamixel interface commands to shell.

The dynamixel interface command set contains the top-level dynamixel library semantic fundamentals.

shell Dynamixel shell.

Definition at line 1467 of file dynashell_cmd_if.cxx.

References DynaShell::PublishCommand().

Referenced by DynaShellCmdChainOut::ArgToUInt(), and MainInit().

1468 {
1469  shell.PublishCommand(NULL, new DynaShellCmdCreate());
1470  shell.PublishCommand(NULL, new DynaShellCmdDestroy());
1471  shell.PublishCommand(NULL, new DynaShellCmdScan());
1472  shell.PublishCommand(NULL, new DynaShellCmdPing());
1473  shell.PublishCommand(NULL, new DynaShellCmdList());
1474  shell.PublishCommand(NULL, new DynaShellCmdLink());
1475  shell.PublishCommand(NULL, new DynaShellCmdUnlink());
1476  shell.PublishCommand(NULL, new DynaShellCmdMegaScan());
1477  shell.PublishCommand("bg", new DynaShellCmdBgtStart());
1478  shell.PublishCommand("bg", new DynaShellCmdBgtStop());
1479  shell.PublishCommand("bg", new DynaShellCmdBgtGetState());
1480  shell.PublishCommand("set", new DynaShellCmdSetHalfDuplexCtl());
1481 }
Destroy command.
Start the background thread.
Create command.
MegaScan command.
Start the background thread.
Set halfduplex control command.
Start the background thread.
void PublishCommand(const char *sParent, DynaShellCmd *pNewCmd)
Publish new command to shell.
Definition: dynashell.cxx:192
void PublishShellServoCommands ( DynaShell shell)

Publish shell servo commands to shell.

shell Dynamixel shell.

Definition at line 2846 of file dynashell_cmd_servo.cxx.

References DynaShell::PublishCommand().

Referenced by DynaShellCmdChainOut::ArgToUInt(), and MainInit().

2847 {
2848  shell.PublishCommand(NULL, new DynaShellCmdMoveTo());
2849  shell.PublishCommand(NULL, new DynaShellCmdMoveAtSpeedTo());
2850  shell.PublishCommand(NULL, new DynaShellCmdEStop());
2851  shell.PublishCommand(NULL, new DynaShellCmdStop());
2852  shell.PublishCommand(NULL, new DynaShellCmdFreeze());
2853  shell.PublishCommand(NULL, new DynaShellCmdRelease());
2854 
2855  shell.PublishCommand("get", new DynaShellCmdGetOdometer());
2856  shell.PublishCommand("set", new DynaShellCmdSetOdometer());
2857 
2858  shell.PublishCommand("write", new DynaShellCmdCfgWriteServoMode());
2859 
2860  shell.PublishCommand("read", new DynaShellCmdReadTorqueEnable());
2861  shell.PublishCommand("write", new DynaShellCmdWriteTorqueEnable());
2862 
2863  shell.PublishCommand("read", new DynaShellCmdReadGoalPos());
2864  //shell.PublishCommand("read", new DynaShellCmdWriteGoalPos());
2865 
2866  shell.PublishCommand("read", new DynaShellCmdReadGoalSpeed());
2867  shell.PublishCommand("write", new DynaShellCmdWriteGoalSpeed());
2868 
2869  shell.PublishCommand("read", new DynaShellCmdReadMaxTorqueLimit());
2870  shell.PublishCommand("write", new DynaShellCmdWriteMaxTorqueLimit());
2871 
2872  shell.PublishCommand("get", new DynaShellCmdGetSoftTorqueTh());
2873  shell.PublishCommand("set", new DynaShellCmdSetSoftTorqueTh());
2874 
2875  shell.PublishCommand("read", new DynaShellCmdReadCurPos());
2876  shell.PublishCommand("read", new DynaShellCmdReadCurSpeed());
2877 
2878  shell.PublishCommand("read", new DynaShellCmdReadDynamics());
2879  shell.PublishCommand("read", new DynaShellCmdReadHealth());
2880  shell.PublishCommand("clear", new DynaShellCmdClearAlarms());
2881 
2882  shell.PublishCommand("read", new DynaShellCmdReadIsMoving());
2883 
2884  shell.PublishCommand("read", new DynaShellCmdReadByte());
2885  shell.PublishCommand("write", new DynaShellCmdWriteByte());
2886 
2887  shell.PublishCommand("read", new DynaShellCmdReadWord());
2888  shell.PublishCommand("write", new DynaShellCmdWriteWord());
2889 
2890  shell.PublishCommand("dump", new DynaShellCmdDump());
2891 }
Read servo byte value at address.
Write servos on power-up or run-time maximum torque limits.
Determine if servos are moving.
Determine if servos are moving.
Read servo byte value at address.
Read servos current positions.
Determine if servos are moving.
Read servos goal positions.
Read servos goal positions.
Read servos current positions.
Determine if servos are moving.
Determine if servos are moving.
Read servos goal positions.
Emergency stop command.
Read servos goal positions.
Determine if servos are moving.
Read servos goal positions.
Determine if servos are moving.
Write byte value to servo at address.
void PublishCommand(const char *sParent, DynaShellCmd *pNewCmd)
Publish new command to shell.
Definition: dynashell.cxx:192
Read servo byte value at address.
Read servos goal positions.
Write EEPROM configuration to put servos into the given modes.
Write byte value to servo at address.
Read servos goal positions.
Determine if servos are moving.
Read servos on power-up or run-time maximum torque limits.
Stop servo(s) command.
void PublishShellTrainCommands ( DynaShell shell)

Publish shell servo commands to shell.

shell Dynamixel shell.

Definition at line 2260 of file dynashell_cmd_train.cxx.

References DynaShell::PublishCommand().

Referenced by DynaShellCmdChainOut::ArgToUInt().

2261 {
2262  shell.PublishCommand("get", new DynaShellCmdGetPid());
2263  shell.PublishCommand("set", new DynaShellCmdSetPid());
2264  shell.PublishCommand("load", new DynaShellCmdLoadRecording());
2265  shell.PublishCommand("save", new DynaShellCmdSaveRecording());
2266  shell.PublishCommand(NULL, new DynaShellCmdTrain());
2267  shell.PublishCommand(NULL, new DynaShellCmdPlay());
2268 }
Load recording from file.
Get the PID values for the given servos.
Save recording to file.
Record dynamixel chain movements.
Record dynamixel chain movements.
Get the PID values for the given servos.
void PublishCommand(const char *sParent, DynaShellCmd *pNewCmd)
Publish new command to shell.
Definition: dynashell.cxx:192