Skip to content

Siva2002-baka/turtlebot3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TurtleBot3 ROS 2 Simulation and Navigation

1. Overview

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.


2. Repository Structure

.
├── 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

3. Robot Description

The robot is defined inside the urdf/ directory.

Supported models:

  • turtlebot3_burger
  • turtlebot3_waffle
  • turtlebot3_waffle_pi

3.1 Robot Capabilities

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/


4. Configuration Files

All system parameters are located inside the config/ directory.

4.1 Navigation Configuration

nav2_params.yaml

Production-ready Navigation2 configuration using the MPPI controller.

nav2.1_params.yaml

Experimental parameter file for controller tuning and testing.

4.2 SLAM Configuration

mapper_params_online_async.yaml

Used for SLAM Toolbox in online asynchronous mode.

Defines:

  • Scan matching
  • Loop closure
  • Pose graph optimization

4.3 Localization Configuration

localization_params_online_async.yaml

Defines:

  • Laser model parameters
  • Motion model parameters
  • Frame definitions
  • Filter tuning

4.4 RViz Configurations

turtlebot3.rviz
turtlebot3_map.rviz

Preconfigured visualization layouts for robot state, map display, costmaps, and navigation goals.


5. Maps

All map data is stored in:

maps/

5.1 Primary Maze Map

  • 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.

5.2 Alternative Map

  • spiralmazemap.yaml
  • spiralmazemap.pgm

Used for testing and experimentation.


6. Launch Files

Launch scripts are located in the launch/ directory.

6.1 Empty World Launch

ros2 launch turtlebot3 turtlebot3.launch.py

This launches:

  • Gazebo
  • TurtleBot3 robot
  • Robot state publisher

Use cases:

  • Robot validation
  • Sensor testing
  • Manual control
  • SLAM mapping

6.2 Autonomous Maze Navigation

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

7. Navigation Workflow

After launching mazebot.launch.py:

  1. Wait for lifecycle nodes to become active.
  2. In RViz, use the "2D Pose Estimate" tool to align localization.
  3. Select the "Nav2 Goal" tool.
  4. 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

8. Manual Testing and Teleoperation

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

9. MPPI Controller

The Model Predictive Path Integral (MPPI) controller is used as the local controller in Navigation2.

9.1 Operating Principle

  1. Sample multiple control trajectories.
  2. Evaluate trajectories using cost functions.
  3. Select the optimal trajectory.
  4. Publish velocity commands.

9.2 Advantages

  • 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


10. Installation and Build

10.1 Clone Repository

cd ~/ros2_ws/src
git clone https://github.com/Siva2002-baka/turtlebot3.git

10.2 Install Dependencies

cd ~/ros2_ws
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y

10.3 Build and Source

colcon build --packages-select turtlebot3
source install/setup.bash

11. System Architecture Summary

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.


12. Customization

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/


13. Conclusion

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages