Skip to content

ROS2 Integration

The RoArm-M2-S has an official ROS2 workspace that provides URDF models, MoveIt2 configuration, Gazebo simulation, and topic-based control interfaces. The workspace is designed for ROS2 Humble on Ubuntu 22.04.

The ROS2 integration provides:

  • URDF/Xacro model — Accurate 3D model with joint limits and collision geometry
  • MoveIt2 configuration — Motion planning with collision avoidance
  • Gazebo simulation — Test control code without physical hardware
  • ROS2 topics — Publish joint commands, subscribe to feedback
  • Launch files — Pre-configured launch configurations for common setups

The workspace source code is available from Waveshare:

Terminal window
# Clone the workspace
git clone https://github.com/waveshareteam/roarm_m2.git
cd roarm_m2
# Install dependencies
rosdep install --from-paths src --ignore-src -r -y
# Build
colcon build --symlink-install
# Source
source install/setup.bash

Waveshare provides nine detailed ROS2 tutorials. Each covers a specific aspect of the ROS2 integration:

Terminal window
ros2 launch roarm_description display.launch.py
Terminal window
ros2 launch roarm_moveit_config demo.launch.py
Terminal window
ros2 launch roarm_gazebo gazebo.launch.py
Terminal window
ros2 launch roarm_driver roarm_driver.launch.py port:=/dev/ttyUSB0
TopicTypeDirectionDescription
/joint_statessensor_msgs/JointStatePublishedCurrent joint positions
/joint_commandsstd_msgs/StringSubscribedJSON command strings
/arm_feedbackstd_msgs/StringPublishedPosition and torque feedback
graph TD
    A[MoveIt2 Planner] --> B[Trajectory Controller]
    B --> C[ROS2 Driver Node]
    C --> D{Transport}
    D -->|Serial| E[ESP32]
    D -->|WiFi/HTTP| E
    E --> F[Servo Bus]
    F --> G[Joint Actuators]
    G --> H[Encoder Feedback]
    H --> E
    E --> C
    C --> I[/joint_states Topic]

ROS2 integration maintained by Waveshare. Tutorial links point to the Waveshare wiki — these are out of scope for this documentation site but are included as reference.