SkillAgentSearch skills...

Diffbot

DiffBot is an autonomous 2wd differential drive robot using ROS Noetic on a Raspberry Pi 4 B. With its SLAMTEC Lidar and the ROS Control hardware interface it's capable of navigating in an environment using the ROS Navigation stack and making use of SLAM algorithms to create maps of unknown environments.

Install / Use

/learn @ros-mobile-robots/Diffbot

README

DiffBot

CI Documentation CI

DiffBot is an autonomous differential drive robot with two wheels. Its main processing unit is a Raspberry Pi 4 B running Ubuntu Mate 20.04 and the ROS 1 (ROS Noetic) middleware. This respository contains ROS driver packages, ROS Control Hardware Interface for the real robot and configurations for simulating DiffBot. The formatted documentation can be found at: https://ros-mobile-robots.com.

| DiffBot | Lidar SLAMTEC RPLidar A2 | |:-------:|:-----------------:| | <img src="https://raw.githubusercontent.com/ros-mobile-robots/ros-mobile-robots.github.io/main/docs/resources/diffbot/diffbot-front.png" width="700"> | <img src="https://raw.githubusercontent.com/ros-mobile-robots/ros-mobile-robots.github.io/main/docs/resources/diffbot/rplidara2.png" width="700"> |

If you are looking for a 3D printable modular base, see the remo_description repository. You can use it directly with the software of this diffbot repository.

| Remo | Gazebo Simulation | RViz | |:-------:|:-----------------:|:----:| | <img src="https://raw.githubusercontent.com/ros-mobile-robots/ros-mobile-robots.github.io/main/docs/resources/remo/remo_front_side.jpg" width="700"> | <img src="https://raw.githubusercontent.com/ros-mobile-robots/ros-mobile-robots.github.io/main/docs/resources/remo/remo-gazebo.png" width="700"> | <img src="https://raw.githubusercontent.com/ros-mobile-robots/ros-mobile-robots.github.io/main/docs/resources/remo/camera_types/oak-d.png?raw=true" width="700"> |

It provides mounts for different camera modules, such as Raspi Cam v2, OAK-1, OAK-D and you can even design your own if you like. There is also support for different single board computers (Raspberry Pi and Nvidia Jetson Nano) through two changable decks. You are agin free to create your own.

Demonstration

SLAM and Navigation

| Real robot | Gazebo Simulation | |:-------:|:-----------------:| | <img src="https://img.youtube.com/vi/IcYkQyzUqik/hqdefault.jpg" width="250"> | <img src="https://img.youtube.com/vi/gLlo5V-BZu0/hqdefault.jpg" width="250"> <img src="https://img.youtube.com/vi/2SwFTrJ1Ofg/hqdefault.jpg" width="250"> |

:package: Package Overview

Installation

The packages are written for and tested with ROS 1 Noetic on Ubuntu 20.04 Focal Fossa. For the real robot Ubuntu Mate 20.04 for arm64 is installed on the Raspberry Pi 4 B with 4GB. The communication between the mobile robot and the work pc is done by configuring the ROS Network, see also the documentation.

Dependencies

The required Ubuntu packages are listed in software package sections found in the documentation. Other ROS catkin packages such as rplidar_ros need to be cloned into the catkin workspace.

For an automated and simplified dependency installation process install the vcstool, which is used in the next steps.

sudo apt install python3-vcstool

:hammer: How to Build

To build the packages in this repository including the Remo robot follow these steps:

  1. cd into an existing ROS Noetic catkin workspace or create a new one:

    mkdir -p catkin_ws/src
    
  2. Clone this repository in the src folder of your ROS Noetic catkin workspace:

    cd catkin_ws/src
    
    git clone https://github.com/fjp/diffbot.git
    
  3. Execute the vcs import command from the root of the catkin workspace and pipe in the diffbot_dev.repos or remo_robot.repos YAML file, depending on where you execute the command, either the development PC or the SBC of Remo to clone the listed dependencies. Run the following command only on your development machine:

    vcs import < src/diffbot/diffbot_dev.repos
    

    Run the next command on Remo robot's SBC:

    vcs import < src/diffbot/remo_robot.repos
    
  4. Install the requried binary dependencies of all packages in the catkin workspace using the following rosdep command:

    rosdep install --from-paths src --ignore-src -r -y
    
  5. After installing the required dependencies build the catkin workspace, either with catkin_make:

    catkin_ws$ catkin_make
    

    or using catkin-tools:

    catkin_ws$ catkin build
    
  6. Finally, source the newly built packages with the devel/setup.* script, depending on your used shell:

    For bash use:

    catkin_ws$ source devel/setup.bash
    

    For zsh use:

    catkin_ws$ source devel/setup.zsh
    

Usage

The following sections describe how to run the robot simulation and how to make use of the real hardware using the available package launch files.

Gazebo Simulation with ROS Control

Control the robot inside Gazebo and view what it sees in RViz using the following launch file:

roslaunch diffbot_control diffbot.launch

This will launch the default diffbot world db_world.world.

To run the turtlebot3_world make sure to download it to your ~/.gazebo/models/ folder, because the turtlebot3_world.world file references the turtlebot3_world model. After that you can run it with the following command:

roslaunch diffbot_control diffbot.launch world_name:='$(find diffbot_gazebo)/worlds/turtlebot3_world.world'

| db_world.world | turtlebot3_world.world | |:-------------------------------------:|:--------------------------------:| | corridor-world | turtlebot3-world |

Navigation

To navigate the robot in the Gazebo simulator in db_world.world run the command:

roslaunch diffbot_navigation diffbot.launch

This uses a previously mapped map of db_world.world (found in diffbot_navigation/maps) that is served by the map_server. With this you can use the 2D Nav Goal in RViz directly to let the robot drive autonomously in the db_world.world.

DiffBot navigation

To run the turtlebot3_world.world (or your own stored world and map) use the same diffbot_navigation/launch/diffbot.launch file but change the world_name and map_file arguments to your desired world and map yaml files:

roslaunch diffbot_navigation diffbot.launch world_name:='$(find diffbot_gazebo)/worlds/turtlebot3_world.world' map_file:='$(find diffbot_navigation)/maps/map.yaml'

DiffBot navigation

SLAM

To map a new simulated environment using slam gmapping, first run

roslaunch diffbot_gazebo diffbot.launch world_name:='$(find diffbot_gazebo)/worlds/turtlebot3_w

Related Skills

View on GitHub
GitHub Stars371
CategoryDevelopment
Updated22h ago
Forks96

Languages

C++

Security Score

100/100

Audited on Mar 24, 2026

No findings