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. Also a webcontrol feature is implemented.
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
ros2 launch rosbridge_server rosbridge_websocket_launch.xmlcd roomba_webpython3 -m http.server 8000Open on a device with internet:
http://ip_adress_of_raspberry:8000/Ensure that the serial connection between the computer and Roomba is properly established.
Verify that the correct serial port is being used in your launch files.
If commands are not working, check the Roomba's logs to see if there are any communication issues.
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.
Feel free to modify the README as needed for your specific project! If you have further questions or need more details, let me know!
This project uses code from RosTeamWorkspace, licensed under the Apache License 2.0.