Quick Start for Dynamixel Pro v1.00b
// WriteWord is the appropriate function
DXL.WriteWord(1, GOAL_TORQUE, GoalTorque, 0);
break;
case
0x31:
// "1" key to set in Wheel Mode
DXL.WriteByte(1, OPERATING_MODE, 1, 0);
usleep(CONTROL_PERIOD*100);
DXL.WriteByte(1, TORQUE_ENABLE, 1, 0);
usleep(CONTROL_PERIOD*100);
// Goal Velocity (600) size is 4 bytes (a double-word)
// WriteDWord is the appropriate function
DXL.WriteDWord(1, GOAL_VELOCITY, GoalVel, 0);
break;
defaultt:
// every other key and Dynamixel PRO remains in Joint Mode
DXL.WriteByte(1, OPERATING_MODE, 3, 0);
usleep(CONTROL_PERIOD*100);
DXL.WriteByte(1, TORQUE_ENABLE, 1, 0);
usleep(CONTROL_PERIOD*100);
// Goal Position (596) size is 4 bytes (a double-word)
// WriteDWord is the appropriate function
DXL.WriteDWord(1, GOAL_POSITION, GoalPos, 0);
break; }
}
...
// must close USB-to-Dynamixel before ending
DXL.Disconnect();
return
0;
}
Similarly as multiple write functions can be applied; multiple read functions can be implemented.
/dxl_sdk-20/example/ReadValues/main.cpp (partly shown)
...
// declare the following in preprocessor for illustrative purposes
#define OPERATING_MODE
#define TORQUE_ENABLE
#define GOAL_POSITION
#define GOAL_TORQUE
#define GOAL_VELOCITY
#define PRESENT_POSITION
#define PRESENT_CURRENT
#define PRESENT_VELOCITY
#define DEFAULT_BAUDNUM
#define CONTROL_PERIOD
...
using namespace
DXL_PRO;
Dynamixel DXL("/dev/ttyUSB0");
int
main()
{
int
GoalPos 250000;
11
562
596
604
600
611
621
615
1
(10)
// time period, arbitrary value
// must declare location of USB-to-Dynamixel
// for 54-series
Page 124 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?
Questions and answers