ROS 2 stack for the FastBot differential drive robot: real hardware control, LiDAR/camera integration, Gazebo simulation, Nav2 navigation, and RViz visualization. Inspired by The Construct.
Loading README and project media…
A ROS2 workspace for the Fastbot mobile robot platform with differential drive, LiDAR sensor integration, and Gazebo simulation support.
This repository contains ROS2 packages for controlling and simulating the Fastbot robot. The project includes robot description files, hardware drivers, simulation environments, and launch configurations.
This project is inspired by The Construct's FastBot - an open-source ROS 2 robot kit for hands-on robotics learning. Want to learn ROS 2 and robotics? Check out The Construct's courses for comprehensive hands-on training.
This repository provides the complete ROS 2 software stack for building and programming your own FastBot robot. 🤖
Robot description package containing URDF/Xacro files and 3D models for the Fastbot platform.
Launch configurations to bring up the Fastbot robot with all sensors and actuators.
Gazebo simulation environment for the Fastbot robot.
Python package for differential drive control via serial communication.
Custom ROS2 message definitions for serial motor communication.
ROS2 driver for Leishen LiDAR sensors.
The docs/ directory contains build guides and hardware documentation:
See the documentation README for more details.
Install Ubuntu Server 22.04 LTS on your Raspberry Pi (4 or 5 recommended).
Install ROS2 Humble:
# Add ROS2 repository
sudo apt update && sudo apt install -y software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install -y curl
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
# Install ROS2 Humble
sudo apt update
sudo apt install -y ros-humble-ros-base ros-humble-demo-nodes-cpp ros-humble-teleop-twist-keyboard ros-humble-rmw-cyclonedds-cpp ros-humble-joint-state-publisher
sudo apt install -y ros-dev-tools git-all
# Add to .bashrc
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc
Flash the Arduino Nano with ros_arduino_bridge firmware:
ROSArduinoBridge.ino in Arduino IDEencoder_driver.h and motor_driver.hSet up udev rules for consistent device naming:
# Find Arduino identifiers
udevadm info -a -n /dev/ttyUSB0 | grep '{idVendor}\|{idProduct}'
# Create udev rule
sudo nano /etc/udev/rules.d/99-arduino.rules
# Add this line (adjust idVendor and idProduct as needed):
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="arduino_nano"
# Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger
Install all required libraries for LiDAR, camera, and motor control:
# LiDAR dependencies
sudo apt install -y \
libboost-all-dev \
libpcl-dev \
libpcap-dev \
ros-humble-diagnostic-updater \
ros-humble-pcl-conversions
# Camera dependencies
sudo apt install -y \
ros-humble-v4l2-camera \
ros-humble-image-transport-plugins \
v4l-utils
Enable legacy camera driver for compatibility with ros2_v4l2_camera:
sudo nano /boot/firmware/config.txt
Set camera_autodetect=0 and add start_x=1 at the end:
camera_autodetect=0
# Enable camera (legacy driver)
start_x=1
Reboot after changes:
sudo reboot
Clone this repository into your ROS2 workspace:
# Create ROS2 workspace
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
# Clone the repository
git clone https://github.com/legalaspro/fastbot_ros2.git fastbot_ros2
# Build the workspace
cd ~/ros2_ws
colcon build --symlink-install
source install/setup.bash
Launch the complete system with all sensors and motors:
ros2 launch fastbot_bringup bringup.launch.xml
This will start:
/dev/arduino_nano)/dev/lslidar)After launching the robot with bringup, you can visualize the robot in RViz:
# First, launch the robot bringup (in one terminal)
ros2 launch fastbot_bringup bringup.launch.xml
# Then, launch RViz for visualization (in another terminal)
ros2 launch fastbot_description display.launch.py
The RViz display will show:
Launch Gazebo simulation:
ros2 launch fastbot_gazebo one_fastbot_warehouse.launch.py
Control the robot with keyboard:
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap cmd_vel:=/fastbot/cmd_vel
Launch components separately if needed:
# Motor control only
ros2 run serial_motor serial_motor_node
# LiDAR only
ros2 launch lslidar_driver lslidar_launch.py
# Camera only
ros2 run v4l2_camera v4l2_camera_node
For detailed step-by-step instructions on building the robot from scratch, see the Build Guide. The build guide shows the incremental evolution of the robot:
This project is licensed under the MIT License - see the LICENSE file for details.
Dmitri Manajev