04 / 06 Personal Project

ROS2 4WD Mobile
Robot Simulation

Overview

Background &
Objective

This project is a ROS 2 4-wheel-drive mobile robot simulated end-to-end in Gazebo and visualized in RViz. The robot integrates LiDAR and RGB camera sensors and supports full teleoperation, serving as a complete baseline for mobile robot perception, motion, and system bringup which is built using a modular ROS 2 package architecture rather than a single monolithic node.

The project is structured around four core focus areas:

  • ROS 2 modular architecture using separate description and bringup packages, keeping the robot's URDF/Xacro definitions decoupled from its simulation launch logic.
  • Sensor integration with LiDAR and camera Gazebo plugins, publishing real-time topics for downstream perception tasks.
  • Differential drive kinematics for realistic wheel-based motion across all four wheels.
  • Simulation-first validation using Gazebo physics and RViz visualization before any hardware deployment.

The robot's URDF/Xacro files define its structure, wheels, sensor mounts, and coordinate frames, while ROS 2 launch files handle spawning the robot into the Gazebo world along with its controllers and sensor plugins. The LiDAR publishes live scan data on /laser_scan, and the RGB camera streams image data for vision-based tasks. In RViz, the full TF tree, robot model, laser scan, and sensor data are visualized simultaneously, while keyboard teleoperation drives the robot in real time via /cmd_vel velocity commands which gives a complete simulation-to-visualization-to-control loop for mobile robot development.

Project Highlights

⚙️
Modular ROS 2 Packages Separate description & bringup
🛰️
Open Source Available on GitHub
  • Year2026
  • RoleSolo · Design, Build, Simulate
  • OSUbuntu 22.04
  • FrameworkROS 2 Humble
  • SimulatorGazebo 11 + RViz2
  • StatusSimulation Complete
ROS2 4WD Mobile Robot Simulation in Gazebo and RViz
ROS2 4WD Mobile Robot Simulation in Gazebo and RViz
4WD
Wheel-Based Motion Model
ROS2Humble
Middleware
2pkgs
Description + Bringup
Py3.10+
Control & Tooling
Process

How it
was built

01
Problem
Most beginner ROS 2 robot examples bundle description, simulation, and control logic into a single package, making them hard to extend or reuse. The goal was to build a clean, modular 4WD robot baseline with proper sensor integration that could later be extended toward SLAM and Nav2 without restructuring the codebase.
02
Approach
Defined the robot in URDF/Xacro with separate description and bringup packages. Attached Gazebo LiDAR and camera plugins to publish live sensor topics, wired up differential-drive control across all four wheels, and validated everything visually in RViz alongside keyboard teleoperation.
03
Results
Achieved a fully working simulation loop: the robot spawns in Gazebo, streams LiDAR and camera data in real time, and can be driven manually via teleop while its TF tree and laser scan render correctly in RViz which is a complete, reusable foundation for further perception and navigation work.
System Design

System
Architecture

The project is split into two ROS 2 packages. The description package holds the robot's URDF/Xacro files, defining its structure, wheels, sensors, and coordinate frames that are kept entirely independent of simulation logic.

The bringup package handles the Gazebo world, spawns the robot, and launches its controllers and sensor plugins through ROS 2 launch files, so the same description can later be reused across different simulation or hardware bringups.

A simple data flow governs operation: Spawn → Sense (LiDAR + Camera) → Visualize (RViz) → Teleop Control → Motion (4WD).

01
Robot Description
URDF/Xacro · wheels, sensors, frames
02
Simulation Bringup
Gazebo world, controllers & plugins via ROS2 launch
03
Sensor Data Flow
LiDAR → /laser_scan · Camera → image topic
04
Visualization
RViz2 · TF tree, robot model, laser scan
05
Teleoperation
Keyboard input → /cmd_vel velocity commands
06
4WD Motion
Differential drive · all four wheels
Tech Stack

Built with

ROS 2 Humble Gazebo 11 RViz2 URDF / Xacro Python 3.10+ LiDAR Simulation RGB Camera Plugin Differential Drive Kinematics TF2 Keyboard Teleop Colcon Ubuntu 22.04
4WD Differential Drive
A realistic wheel-based motion model driving all four wheels, giving the robot smooth, physically accurate movement inside the Gazebo physics environment.
LiDAR Sensor Integration
A simulated LiDAR plugin publishes live /laser_scan data, supporting downstream perception and mapping work straight out of the box.
RGB Camera Sensor
A simulated RGB camera streams image data in real time, enabling future vision-based tasks such as object detection on top of the same baseline.
RViz Visualization & Teleop
The full TF tree, robot model, laser scan, and sensor data render live in RViz, while keyboard teleoperation drives the robot manually via velocity commands.
Source Code & Docs
See it
on GitHub
View on GitHub ← All Projects