Skip to content

Dynamixel Robotic Development Kit. ROS2 based dynamixel smart actuator controller package. Supports syncwrite, bulkread etc.

License

Notifications You must be signed in to change notification settings

mjlee111/dynamixel-RDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamixel-RDK

Dynamixel ROS Development Kit for Sync Read and Write.

Overview

This repository contains a ROS2 package for Dynamixel Sync Read and Write based on Dynamixel SDK.

Features

  • 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

Requirements

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

Development Environment

Component Version
OS Ubuntu 22.04
ROS Humble Hawksbill

Installation

  1. Install Dynamixel SDK
    Please refer to the Dynamixel SDK for installation.

  2. Clone this repository

    $ cd ~/ros2_ws/src
    $ git clone https://github.com/mjlee111/dynamixel-RDK.git
  3. Build the workspace

    $ cd ~/ros2_ws
    $ colcon build
  4. Source the workspace

    $ source ~/ros2_ws/install/setup.bash

Launching the node & Set Lifecycle Node

  1. Launch the node
    To run the dynamixel_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

  1. Set Lifecycle Node
    To set the node as a lifecycle node, you can use the ros2 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.

Parameters

The node supports various parameters that can be configured via a YAML file or command line arguments. Here's a table of parameters:

Parameters in YAML file

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

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 Position to Radian Conversion

dynamixel_rdk_ros uses [radian] as the unit of position. Here is the conversion explanation image.

dynamixel_position_to_radian

Contributing

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.

License

This project is licensed under the Apache 2.0 License. Feel free to use and distribute it according to the terms of the license.

Contact

If you have any questions or feedback, don't hesitate to reach out! You can contact me at [email protected].

About

Dynamixel Robotic Development Kit. ROS2 based dynamixel smart actuator controller package. Supports syncwrite, bulkread etc.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published