This project implements a ROS2 hardware interface and controller for the iRobot® Roomba® using the Serial Command Interface (SCI) specification. It provides a seamless way to control Roomba's movement via the Diff Drive Controller in ROS2. Make sure to use the right branch for your version. Currently available: 500er and 600er.
Interface to control Roomba's velocity using ROS2 messages.
Compatible with ROS2-based systems.
Can be used to send commands to Roomba for movement control. Different controllers can be used.
Utilizes the iRobot® Roomba® Serial Command Interface (SCI) for communication.
ROS2 (e.g., Foxy, Galactic, or Humble)
iRobot® Roomba® with SCI support
A working serial connection between the host computer and Roomba.
- Clone the repository
git clone https://github.com/TaylorDelta/RoombaRos2Control.git
cd roomba_ros2_controller- Install dependencies
Install necessary ROS2 dependencies for your workspace:
sudo apt update
sudo apt install ros-<ros2-distro>-serial
sudo apt install ros-<ros2-distro>-rosbridge-server- Build the workspace
From your ROS2 workspace, build the project:
colcon build- Source the workspace
After building, source the workspace to ensure that ROS2 can find the packages:
source install/setup.bashLaunch the Roomba Controller
To launch the hardware interface and controller, run the following command:
ros2 launch robot_bringup robot_x.launch.pyThis will start the necessary ROS2 nodes for controlling your Roomba robot.
You can use the Diff Drive Controller to send movement commands to Roomba. To send a command, run the following command in a separate terminal:
ros2 topic pub /diff_drive_controller/cmd_vel geometry_msgs/msg/TwistStamped "{header: {stamp: {sec: 0, nanosec: 0}, frame_id: 'base_link'}, twist: {linear: {x: 0.1, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.2}}}" -r 10This results in the Roomba driving a circle with diameter of 1m at a speed of 100mm/s
Make sure Foxglove Bridge is installed in your ROS2 workspace:
sudo apt install ros-${ROS_DISTRO}-foxglove-bridgeStart the ROS2 ↔ Foxglove WebSocket bridge
ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=8765Foxglove needs geometry_msgs/msg/Twist, the controller wants geometry_msgs/msg/TwistStamped, so twist_bridge creates /cmd_vel_fg without stamped
ros2 run twist_bridge twist_to_stampedEnsure that the serial connection between the computer and Roomba is properly established.
Verify that the correct serial port is being used in the launch files.
If you encounter a problem that isn’t already documented, please create a new issue. Make sure to clearly describe the problem, steps to reproduce it, and any relevant error messages.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
The iRobot® Roomba® Serial Command Interface (SCI) Specification
ROS2 and the ROS community for providing an open-source platform for robotics development.
This project uses code from RosTeamWorkspace, licensed under the Apache License 2.0.