This repository provides a complete ROS 2 package for simulating, mapping, localizing, and navigating a TurtleBot3 (Burger and Waffle Pi variants) using Gazebo and the Navigation2 (Nav2) stack.
The package name is:
turtlebot3
The system includes:
- Gazebo simulation environment
- SLAM configuration
- Map-based localization
- Navigation2 with MPPI controller
- Modular robot description using URDF/Xacro
- Teleoperation support
- Preconfigured RViz environments
This repository is structured for academic use, experimentation, and controller evaluation in maze-based environments.
.
├── config/
│ ├── localization_params_online_async.yaml
│ ├── mapper_params_online_async.yaml
│ ├── nav2_params.yaml
│ ├── nav2.1_params.yaml
│ ├── turtlebot3_map.rviz
│ └── turtlebot3.rviz
│
├── launch/
│ ├── mazebot.launch.py
│ └── turtlebot3.launch.py
│
├── maps/
│ ├── mazeofmap.yaml
│ ├── mazeofmap.pgm
│ ├── mazeofmap.data
│ ├── mazeofmap.posegraph
│ ├── spiralmazemap.yaml
│ └── spiralmazemap.pgm
│
├── meshes/
│ ├── bases/
│ ├── sensors/
│ └── wheels/
│
├── turtlebot3/
│ ├── init.py
│ └── teleop_node.py
│
├── urdf/
│ ├── common_properties.urdf
│ ├── turtlebot3_burger.urdf
│ ├── turtlebot3_burger.xacro
│ ├── turtlebot3_waffle.urdf
│ └── turtlebot3_waffle_pi.urdf
│
├── package.xml
├── setup.py
└── setup.cfg
The robot is defined inside the urdf/ directory.
Supported models:
- turtlebot3_burger
- turtlebot3_waffle
- turtlebot3_waffle_pi
The robot model includes:
- Differential drive base
- LiDAR (360° laser scan)
- IMU
- Camera support
- Proper TF hierarchy
- Mesh-based visualization and collision models
Meshes are stored inside:
meshes/
All system parameters are located inside the config/ directory.
nav2_params.yaml
Production-ready Navigation2 configuration using the MPPI controller.
nav2.1_params.yaml
Experimental parameter file for controller tuning and testing.
mapper_params_online_async.yaml
Used for SLAM Toolbox in online asynchronous mode.
Defines:
- Scan matching
- Loop closure
- Pose graph optimization
localization_params_online_async.yaml
Defines:
- Laser model parameters
- Motion model parameters
- Frame definitions
- Filter tuning
turtlebot3.rviz
turtlebot3_map.rviz
Preconfigured visualization layouts for robot state, map display, costmaps, and navigation goals.
All map data is stored in:
maps/
- mazeofmap.yaml
- mazeofmap.pgm
- mazeofmap.data
- mazeofmap.posegraph
This map is used for localization in autonomous navigation.
The .data and .posegraph files indicate it was generated using SLAM Toolbox.
- spiralmazemap.yaml
- spiralmazemap.pgm
Used for testing and experimentation.
Launch scripts are located in the launch/ directory.
ros2 launch turtlebot3 turtlebot3.launch.py
This launches:
- Gazebo
- TurtleBot3 robot
- Robot state publisher
Use cases:
- Robot validation
- Sensor testing
- Manual control
- SLAM mapping
ros2 launch turtlebot3 mazebot.launch.py
This launches:
- Maze world in Gazebo
- Robot spawn
- Map server (mazeofmap)
- Localization
- Navigation2 stack
- MPPI controller
- RViz with map visualization
After launching mazebot.launch.py:
- Wait for lifecycle nodes to become active.
- In RViz, use the "2D Pose Estimate" tool to align localization.
- Select the "Nav2 Goal" tool.
- Set a goal on the map.
The robot will:
- Compute a global path
- Optimize trajectories using MPPI
- Publish velocity commands
- Navigate autonomously to the target location
Launch empty world:
ros2 launch turtlebot3 turtlebot3.launch.py
Run teleoperation:
ros2 run turtlebot3 teleop_node
This allows:
- Manual movement
- Sensor validation
- Map creation
- Debugging
The Model Predictive Path Integral (MPPI) controller is used as the local controller in Navigation2.
- Sample multiple control trajectories.
- Evaluate trajectories using cost functions.
- Select the optimal trajectory.
- Publish velocity commands.
- Smooth path tracking
- Improved obstacle avoidance
- Effective performance in narrow maze environments
- Better dynamic behavior compared to DWB controller
Controller parameters are defined in:
config/nav2_params.yaml
cd ~/ros2_ws/src
git clone https://github.com/Siva2002-baka/turtlebot3.git
cd ~/ros2_ws
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build --packages-select turtlebot3
source install/setup.bash
Robot Model
→ Gazebo Simulation
→ SLAM / Localization
→ Navigation2
→ MPPI Controller
→ Velocity Commands
This package integrates simulation, mapping, localization, and modern predictive control into a structured and extensible ROS 2 project.
To modify navigation behavior:
config/nav2_params.yaml
To experiment with alternate controller tuning:
config/nav2.1_params.yaml
To modify SLAM behavior:
config/mapper_params_online_async.yaml
To modify robot sensors or geometry:
urdf/
This repository provides a complete and modular TurtleBot3 ROS 2 simulation and navigation framework. It integrates Gazebo simulation, SLAM, localization, and MPPI-based autonomous navigation into a structured system suitable for research, controller evaluation, and robotics experimentation.