Robotis Dynamixel Pro Quick Start Manual page 121

Table of Contents

Advertisement

Quick Start for Dynamixel Pro v1.00b
// This step is essential. After Torque Enable is on RAM area addresses can be changed.
DXL.WriteByte(1, TORQUE_ENABLE, 1,
// after enabling Torque Enable
// sad main routine involving RAM address(es) here (i.e. Goal Position)
...
// the following lines verify that Dynamixel's Torque Enable has been turned on
// by outputting a "1" onscreen
result = DXL.ReadByte(1, TORQUE_ENABLE, &On, &error);
if
(result ==
COMM_RXSUCCESS)
printf( "%d\n", On);
// must close USB-to-Dynamixel before ending
DXL.Disconnect();
return
0;
}
1.4.3 Implementing read/write functions
i. Write functions
-
Monitor for Dynamixel PRO in Linux emphasized that different size addresses
required different type of write commands. The same concept applies at the source
code level.
-
There are 4 types of write commands for Dynamixel PRO
-
Implement WriteByte for addresses with size of 1 byte
-
Implement WriteWord for addresses with size of 2 bytes
-
Implement WriteDWord for addresses with size of 4 bytes
-
Implement SyncWrite (explained later) for for multiple Dynamixel PROs at
once.
ii. Read functions
-
Monitor for Dynamixel PRO in Linux emphasized that different size addresses
required different type of read commands. The same concept applies at the source
code level.
-
There are 4 types of write commands for Dynamixel PRO
-
Implement ReadByte for addresses with size of 1 byte
-
Implement ReadWord for addresses with size of 2 bytes
-
Implement ReadDWord for addresses with size of 4 bytes
-
Implement BulkRead (explained later) for multiple Dynamixel PROs at once.
The following example is a simple read/write sample code of Dynamixel PRO in Joint Mode (default)
/dxl_sdk-20/example/ReadWrite/main.cpp (partly shown)
// declare the following in preprocessor for illustrative purposes
#define P_TORQUE_ENABLE
#define P_GOAL_POSITION_LL
#define P_PRESENT_POSITION_LL
#define P_MOVING
0);
562
596
611
610
Page 121 / 139

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Dynamixel Pro and is the answer not in the manual?

Questions and answers

Table of Contents