Skip to content

Commit

Permalink
docs: edit README.md
Browse files Browse the repository at this point in the history
- add dynamixel_rdk_msgs/README.md for msg system description
- fix dynamixel SDK link
  • Loading branch information
mjlee111 committed Nov 15, 2024
1 parent 8e77806 commit b9e3d38
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ Dynamixel ROS Development Kit for Sync Read and Write.
</div>

## Overview
This repository contains a ROS2 package for Dynamixel Sync Read and Write. Supports **Lifecycle Node** system.
This repository contains a ROS2 package for Dynamixel Sync Read and Write based on [Dynamixel SDK](https://github.com/ROBOTIS-GIT/DynamixelSDK).

## 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](dynamixel_rdk_msgs/README.md)

## 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 | [Dynamixel SDK](https://github.com/ROBOTIS-GIT/DynamixelSDK) | Dynamixel SDK for controlling Dynamixel |
| Dynamixel SDK | [github](https://github.com/ROBOTIS-GIT/DynamixelSDK) | Dynamixel SDK for controlling Dynamixel |

## Development Environment

Expand Down Expand Up @@ -50,12 +57,13 @@ To use the packages in this repository, make sure you have the following install
## Launching the node & Set Lifecycle Node

1. **Launch the node** <br>
To run the `dynamixel_rdk_node`, use the provided [launch file](dynamixel_rdk_ros/launch/dynamixel_rdk.launch.py). It supports loading parameters from a YAML file or directly through launch arguments.
To run the `dynamixel_rdk_node`, use the provided [dynamixel_rdk.launch.py](dynamixel_rdk_ros/launch/dynamixel_rdk.launch.py). It supports loading parameters from a YAML file or directly through launch arguments.

**Example launch command:**
```bash
$ ros2 launch dynamixel_rdk_ros dynamixel_rdk.launch.py
```
<br>

2. **Set Lifecycle Node** <br>
To set the node as a lifecycle node, you can use the `ros2 lifecycle set` command.
Expand Down Expand Up @@ -88,6 +96,7 @@ To use the packages in this repository, make sure you have the following install

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. |
Expand All @@ -97,6 +106,20 @@ The node supports various parameters that can be configured via a YAML file or c
| `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](dynamixel_rdk_ros/config/dynamixel.yaml)
```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]
```
## 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.
Expand Down
49 changes: 49 additions & 0 deletions dynamixel_rdk_msgs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Dynamixel RDK Messages
This package contains the ROS2 messages for the Dynamixel RDK. Messages are adapted from the [Dynamixel SDK Protocol 2.0](https://emanual.robotis.com/docs/en/dxl/protocol2/).

## Messages
### `DynamixelStatusMsgs`
Status message of the Dynamixel motor.

| Field | Type | Description |
|-------|------|-------------|
| header | std_msgs/Header | The header of the message. |
| id | uint8 | The ID of the Dynamixel motor. |
| torque_enabled | bool | Whether the torque is enabled. |
| error_status | uint8 | The error status of the Dynamixel motor. |
| present_position | float64 | The present position of the Dynamixel motor. |
| present_velocity | float64 | The present velocity of the Dynamixel motor. |
| present_acceleration | float64 | The present acceleration of the Dynamixel motor. |
| present_current | float64 | The present current of the Dynamixel motor. |
| present_voltage | float64 | The present voltage of the Dynamixel motor. |
| present_temperature | float64 | The present temperature of the Dynamixel motor. |

### `DynamixelMsgs`
Control message of the Dynamixel motor.

| Field | Type | Description |
|-------|------|-------------|
| header | std_msgs/Header | The header of the message. |
| goal_position | float64 | The goal position of the Dynamixel motor. |
| profile_acceleration | float64 | The profile acceleration of the Dynamixel motor. |
| profile_velocity | float64 | The profile velocity of the Dynamixel motor. |

### `DynamixelBulkReadMsgs`
Bulk read message of the Dynamixel motor.

| Field | Type | Description |
|-------|------|-------------|
| status_msgs | DynamixelStatusMsgs[] | The status messages of the Dynamixel motors. |

### `DynamixelBulkWriteMsgs`
Bulk write message of the Dynamixel motor.

| Field | Type | Description |
|-------|------|-------------|
| control_msgs | DynamixelMsgs[] | The control messages of the Dynamixel motors. |

## Disclaimer
- This package is based on the [Dynamixel SDK](https://github.com/ROBOTIS-GIT/DynamixelSDK), and the messages are adapted from the SDK.
- The error status of the Dynamixel motor is based on the [Dynamixel Protocol 2.0 status packet](https://emanual.robotis.com/docs/en/dxl/protocol2/#status-packet).
- `DynamixelBulkWriteMsgs` and `DynamixelMsgs` does not contains **id**. You need to push `DynamixelMsgs` to the `DynamixelBulkWriteMsgs` sequentially.

0 comments on commit b9e3d38

Please sign in to comment.