This repository is used for developing the humanoid robot.
It contains an integration of the Seeed-Projects/RobStride_Control motor SDK adapted for ROS 2 Jazzy on Ubuntu 24.04.
The project ships two equivalent ROS 2 drivers for RobStride motors:
- a C++ driver (
robstride_control) - a Python driver (
robstride_control_py)
Both expose the same ROS 2 interface, so you can pick whichever language you prefer. This README walks through both options step by step.
Metabot/
├── robstride_control_upstream/ # Vendored copy of the upstream project
│ # (C++, Python, Rust, Arduino — kept as reference)
└── src/ # colcon workspace
├── robstride_control/ # ament_cmake C++ ROS 2 driver
└── robstride_control_py/ # ament_python ROS 2 driver
| Topic | Type | Direction | Description |
|---|---|---|---|
/joint_states |
sensor_msgs/JointState |
publish | Measured position / velocity / effort |
/joint_commands |
sensor_msgs/JointState |
subscribe | Target joint positions (rad) |
Configuration (CAN interface, joint names, motor IDs, gains, publish rate) is set through ROS 2 parameters. The defaults live in:
src/robstride_control/config/robstride.yaml(C++)src/robstride_control_py/config/robstride.yaml(Python)
You need:
- Ubuntu 24.04 (Noble)
- ROS 2 Jazzy Jalisco installed under
/opt/ros/jazzy(install guide) can-utilsand a working SocketCAN interface (e.g. a USB‑CAN adapter connected to your RobStride motor)- For the Python driver:
python-can,numpy,tqdm
Install everything in one go:
sudo apt update
sudo apt install -y \
ros-jazzy-ros-base \
ros-jazzy-sensor-msgs \
python3-colcon-common-extensions \
can-utils python3-can python3-numpy python3-tqdmgit clone https://github.com/Haziq-yusri/Metabot.git
cd MetabotThe rest of this guide assumes your terminal is in the
Metabot/directory.
The RobStride motors run at 1 Mbps as in the upstream project:
sudo ip link set can0 type can bitrate 1000000
sudo ip link set up can0Quick sanity check — you should see the interface listed as UP:
ip -details link show can0Open the YAML file for the driver you plan to use and adjust the values to match your hardware:
- C++:
src/robstride_control/config/robstride.yaml - Python:
src/robstride_control_py/config/robstride.yaml
The most important fields are:
can_interface— usually"can0"joint_names— names you want to publish on/joint_statesmotor_ids— the CAN IDs of your motors (one per joint)default_kp,default_kd— position / damping gainsvelocity_limit,torque_limit— safety limitspublish_rate_hz— how often/joint_statesis published
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install --packages-select robstride_control
source install/setup.bashIf you haven’t already, run the commands from Section 3.
ros2 launch robstride_control robstride.launch.pyYou should see the node start and begin publishing /joint_states.
In a new terminal (don’t forget to source install/setup.bash again):
# See the measured joint state stream
ros2 topic echo /joint_states
# List the active topics
ros2 topic listIn another terminal, send a target position in radians:
ros2 topic pub --once /joint_commands sensor_msgs/msg/JointState \
'{name: ["joint_1"], position: [1.57]}'To stop the driver, press Ctrl+C in the launch terminal.
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install --packages-select robstride_control_py
source install/setup.bashTip:
--symlink-installlets you edit the Python source files without rebuilding every time.
If you haven’t already, run the commands from Section 3.
ros2 launch robstride_control_py robstride_py.launch.pyIn a new terminal (remember source install/setup.bash):
ros2 topic echo /joint_states
ros2 node listros2 topic pub --once /joint_commands sensor_msgs/msg/JointState \
'{name: ["joint_1"], position: [1.57]}'Press Ctrl+C in the launch terminal to stop the driver.
If you want both packages available in the same workspace:
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install \
--packages-select robstride_control robstride_control_py
source install/setup.bashYou can then launch either one — but do not run both at the same time against the same CAN bus, or they will fight over the motor.
can0does not exist — your USB‑CAN adapter is not plugged in or its driver is missing. Runip linkto see the available interfaces.Operation not permittedwhen bringingcan0up — you needsudo.- No data on
/joint_states— check thatmotor_idsin the YAML match the actual CAN ID of your motor, and that the bitrate is1000000. Package 'robstride_control' not found— you forgot tosource install/setup.bashin the new terminal.- Two drivers running at once — only run the C++ or the Python node, not both, since they share the CAN bus and the same topic names.
- The upstream interactive C++ example
(
robstride_control_upstream/cpp/src/position_control.cpp) was refactored into a reusableMotorDriverlibrary plus a ROS 2 node — the original file is kept untouched for reference. - The upstream Python package
robstride_dynamicsis vendored undersrc/robstride_control_py/robstride_control_py/robstride_dynamics/and used directly by the rclpy node. - The Arduino sketches and the Rust crate live under
robstride_control_upstream/and are not part of the ROS 2 build; they are preserved so you can flash MCU firmware or experiment with the Rust SDK alongside the ROS 2 stack. - Upstream license (MIT) is preserved in
robstride_control_upstream/LICENSE.