This project documents my ongoing effort to learn and understand mobile robot simulation using ROS2. It revolves around simulating a simple, custom differential drive robot that primarily exists in a virtual environment using GazeboSim & RViz.
The repository is intended as a beginner-friendly reference, capturing both working configurations and the lessons learned while setting up robot descriptions, simulation workflows and sensor integration in ROS2.
TL;DR
This project focuses on simulating a simple differential drive robot using ROS2, GazeboSim & RViz. It is beginner-oriented, serving as a living document of my learning and thought process, as well as discoveries while working with ROS2 simulation tools.
- Virtual Machine: VMware Workstation Player 25H2
- Ubuntu: Ubuntu Noble 24.04.3 LTS
- ROS2: Kilted
- Gazebo: Ionic
User may toggle between gazebo_control or ros2_control via use_ros2_control found in launch_sim.launch.py
- Gazebo DiffDrive plugin (gazebo_control) -----> Set
use_ros2_controltofalse - ros2_control -----> Set
use_ros2_controltotrue
The robot performs 2D SLAM in simulation using slam_toolbox, using Grid SLAM approach, it builds an occupancy grid map in real-time based on LiDAR data while localizing itself within the environment.
At the time of this writing, the author is currently working on using AMCL for localization in conjunction with the map generated by
slam_toolbox.
Assigns a cost to different areas of the environment, currently based on a static map generated by SLAM.
At the time of this writing, author is working on using Nav2 for autonomous path planning. Terminal output seems to end on
Creating bond timer..., hinting towardsnav2_stacknot fully initializing. A concern could be attributed to demanding computational power that a Virtual Machine might struggle with. Root cause of issue pending further investigation.
Ball is an asset (RoboCup SPL Ball) provided by OpenRobotics. Tuning parameters can be found in the params file ball_tracker_params.yaml.
Using trigonometry, a 3D position-estimate of the ball can be calculated and visualised in RViz.
cd ~/diffdrive_ws
colcon build --symlink-installsource install/setup.bashIn a new terminal:
ros2 launch diffdrive_bot launch_sim.launch.pyIn another terminal:
rviz2 -d src/diffdrive_bot/config/balltracking.rvizIn a new terminal:
ros2 launch diffdrive_bot ball_tracker.launch.py sim_mode:=trueThis project is inspired by the work of joshnewans and his Articulated Robotics blog and tutorial. The code in this repository is written and maintained for ROS 2 Kilted and Gazebo Ionic.








