Skip to content

A differential wheeled robot simulation with ROS 2 and Gazebo Classic

Notifications You must be signed in to change notification settings

hcdiekmann/pathfinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pathfinder

A ROS 2 Gazebo simulation of a differential drive robot.

Features

  • SLAM thanks to slam_toolbox
  • Autonmous navigation thanks to nav2
  • Autonmous exploration thanks to m_explore
  • Multi-robot simulation

Requirements

  • Gazebo Classic 11.10.2
ROS Version Ubuntu Version Branch Multi-Robot Support
ROS 2 Foxy 20.04 main ☐ No
ROS 2 Humble 22.04 Humble ☑ Yes

Install

  • Clone this repository into your ROS 2 workspace src directory

cd ~/ros2_ws/src 
git clone https://github.com/hcdiekmann/pathfinder.git
  • Build the package and source the underlay installation

cd ~/ros2_ws
colcon build
. install/setup.bash

Run

  • Launch the simulation with optional Gazebo world file argument

ros2 launch pathfinder single_bot_sim.launch.py world:=~/ros2_ws/src/pathfinder/worlds/test.world

Gazebo

  • Control the robot with the teleop_twist_keyboard node

ros2 run teleop_twist_keyboard teleop_twist_keyboard
  • View the LiDAR scan and odometry in RViz

cd ~/ros2_ws
rviz2 -d src/pathfinder/config/view_lidar_sim.rviz                               

RViz

  • View and save the map created by SLAM and navigate the robot autonomously with Nav2 in RViz

cd ~/ros2_ws
rviz2 -d src/pathfinder/config/view_nav2_slam.rviz                               

RViz

  • Spawn multiple robot instances in separate namespaces

This has currently only been tested on ROS 2 Humble

ros2 launch pathfinder multi_bot_sim.launch.py

Launching the simulation with multiple robots automatically starts RViz for each robot.

NOTE: Spawning multiple robots with online SLAM and the full navigation stack in each namespace requires a capable dev machine.