Dynamixel ROS Development Kit for Sync Read and Write.
This repository contains a ROS2 package for Dynamixel Sync Read and Write based on Dynamixel SDK.
- Supports Sync Read and Sync Write for Dynamixel motors
- Supports Bulk Read and Bulk Write for Dynamixel motors
- Supports Lifecycle Node system
- Supports YAML file for parameters
- Status & Control messages support - Dynamixel RDK Messages
- Simple GUI Dynamixel Controller - Dynamixel RDK Manager
To use the packages in this repository, make sure you have the following installed:
Component | Version/Distribution | Notes |
---|---|---|
ROS2 | Humble or higher | Recommended ROS2 distributions |
Dynamixel SDK | github | Dynamixel SDK for controlling Dynamixel |
Component | Version |
---|---|
OS | Ubuntu 22.04 |
ROS | Humble Hawksbill |
-
Install Dynamixel SDK
Please refer to the Dynamixel SDK for installation. -
Clone this repository
$ cd ~/ros2_ws/src $ git clone https://github.com/mjlee111/dynamixel-RDK.git
-
Build the workspace
$ cd ~/ros2_ws $ colcon build
-
Source the workspace
$ source ~/ros2_ws/install/setup.bash
-
Launch the node
To run thedynamixel_rdk_node
, use the provided dynamixel_rdk.launch.py. It supports loading parameters from a YAML file or directly through launch arguments.Example launch command:
$ ros2 launch dynamixel_rdk_ros dynamixel_rdk.launch.py
-
Set Lifecycle Node
To set the node as a lifecycle node, you can use theros2 lifecycle set
command.Configure the node:
$ ros2 lifecycle set dynamixel_rdk_node configure
When the node is configured, it will load the parameters from the YAML file or launch arguments. Also, it will initialize the Dynamixel devices(Set ID, Baud Rate, etc.).
Activate the node:
$ ros2 lifecycle set dynamixel_rdk_node activate
When the node is activated, it will set dynamixel's torque to True and start to publish the status of the Dynamixel devices.
Deactivate the node:
$ ros2 lifecycle set dynamixel_rdk_node deactivate
When the node is deactivated, it will set dynamixel's torque to False.
Shutdown the node:
$ ros2 lifecycle set dynamixel_rdk_node shutdown
When the node is shutdown, it will close the serial port and release the Dynamixel devices.
The node supports various parameters that can be configured via a YAML file or command line arguments. Here's a table of parameters:
Parameter Name | Type | Default Value | Description |
---|---|---|---|
device_port |
string |
/dev/ttyUSB0 |
The serial port to which the device is connected. |
baud_rate |
int |
1000000 |
The baud rate for serial communication. |
control_topic |
string |
/dynamixel_control |
The topic name for control messages. |
status_topic |
string |
/dynamixel_status |
The topic name for status messages. |
dynamixels.ids |
array of int |
[1] |
List of Dynamixel motor IDs to be used. |
dynamixels.types |
array of string |
["MX"] |
List of types of Dynamixel motors (e.g., "MX" for MX series). |
dynamixels.max_position_limits |
array of float |
[3.14159] |
List of maximum position limits for the motors in radians. |
dynamixels.min_position_limits |
array of float |
[-3.14159] |
List of minimum position limits for the motors in radians. |
Example YAML file for three Dynamixel motors - dynamixel.yaml
# ROS2 Parameters
/**:
ros__parameters:
device_port: "/dev/ttyUSB0"
baud_rate: 1000000
dynamixels:
ids: [1, 2, 3]
types: ["MX", "MX", "MX"]
max_position_limits: [3.14159, 3.14159, 3.14159]
min_position_limits: [-3.14159, -3.14159, -3.14159]
dynamixel_rdk_ros
uses [radian] as the unit of position. Here is the conversion explanation image.
I welcome all contributions! Whether it's bug reports, feature suggestions, or pull requests, your input helps me to improve. If you're interested in contributing, please check out my contributing guidelines or submit an issue.
This project is licensed under the Apache 2.0 License. Feel free to use and distribute it according to the terms of the license.
If you have any questions or feedback, don't hesitate to reach out! You can contact me at [email protected].