ros2_controlhardware interface and velocity controller for the SemuBot 3-motor omnidirectional wheelbase.
semubot_ros_control integrates the SemuBot omnidirectional wheelbase into the standard ros2_control framework. It provides:
- A custom
ros2_controlhardware interface (SemuBotHardwareInterface) - A custom omnidirectional velocity controller (
SemuBotVelocityController) - Transport variants: USB CDC serial and micro-ROS over UART/USB
- Optional ROS-side PID experiments
The package is part of the broader SemuBot project — a humanoid robot platform.
The active stack is ros2ctrl-microros: ros2_control running on the PC with micro-ROS handling low-level control on the STM32.
/cmd_vel (geometry_msgs/Twist)
│
▼
SemuBotVelocityController
│
▼
ros2_control command interfaces
│
▼
SemuBotHardwareInterface
│
▼
/hardware_interface/velocity_cmd (std_msgs/Float32MultiArray)
│ data = [M1, M2, M3] — PWM duty commands
▼
STM32 micro-ROS agent
│
▼
PWM → motors
Encoder feedback flows in the opposite direction:
STM32 encoders
│
▼
/motor_states (std_msgs/Float32MultiArray)
│
▼
SemuBotHardwareInterface
│
▼
ros2_control state interfaces
│
▼
SemuBotVelocityController
| Topic | Type | Description |
|---|---|---|
/cmd_vel |
geometry_msgs/Twist |
High-level velocity command |
/motor_states |
std_msgs/Float32MultiArray |
Per-motor encoder feedback from STM32 |
| Topic | Type | Description |
|---|---|---|
/hardware_interface/velocity_cmd |
std_msgs/Float32MultiArray |
Low-level motor commands [M1, M2, M3] |
| Field | Meaning |
|---|---|
linear.x |
Forward / backward |
linear.y |
Left / right (strafe) |
angular.z |
Rotation |
Note: In the current
ros2ctrl-microrosstack,/hardware_interface/velocity_cmdcarries PWM duty cycle values, not wheel velocity targets.
- ROS 2 Jazzy (or later)
ros2_control/ros2_controllersmicro_ros_agent(for micro-ROS transport variant)geometry_msgs,std_msgs- STM32 firmware:
SemuBot-Firmware
cd ~/ros2_ws/src
git clone https://github.com/SemuBot/semubot_ros_control.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-select semubot_ros_control
source install/setup.bashros2 launch semubot_ros_control semubot_control.launch.pyros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
"{linear: {x: 0.2, y: 0.0, z: 0.0}, angular: {z: 0.0}}"ros2 topic echo /hardware_interface/velocity_cmd| Variant | Transport | PID location | Status |
|---|---|---|---|
| 1 | Serial CDC | STM32 | Working |
| 2 (active) | micro-ROS | STM32 | Working — recommended |
| 3 | Serial CDC | ROS 2 | Working |
| 4 | micro-ROS | ROS 2 | Working |
semubot_ros_control/
├── include/semubot_ros_control/
│ ├── semubot_hardware_interface.hpp
│ └── semubot_velocity_controller.hpp
├── src/
│ ├── semubot_hardware_interface.cpp
│ └── semubot_velocity_controller.cpp
├── launch/
│ └── semubot_control.launch.py
├── config/
│ └── joy_config.yaml
│ └── semubot_controllers.yaml
├── CMakeLists.txt
├── package.xml
└── README.md
| Package | Description |
|---|---|
semubot_description |
URDF and mesh assets |
semubot_bringup |
Top-level launch files |
SemuBot-Firmware |
STM32 firmware (FreeRTOS, micro-ROS) |
semubot_driver |
Low-level serial driver utilities |
This project is licensed under the Apache 2.0 license - see the LICENSE file for more information.