Watch TurtleBot3 autonomously explore, map, and navigate a custom house simulation!
This workspace provides TurtleBot3 simulation packages for ROS 2, including:
- Gazebo simulation
- Google Cartographer SLAM
- Custom world models
- Autonomous exploration with
explore_lite
โ SLAM Mapping โ Autonomous Navigation (Nav2) โ Path Planning & Obstacle Avoidance โ AMCL Localization โ Realistic Custom House World โ RViz Visualization โ CycloneDDS for better ROS 2 performance โ Explore Lite for fully autonomous exploration of unknown spaces
ps1_ws/
โโโ src/
โ โโโ turtlebot3/
โ โ โโโ turtlebot3_cartographer/
โ โ โโโ config/
โ โ โโโ turtlebot3_lds_2d.lua
โ โโโ turtlebot3_simulations/
โ โโโ turtlebot3_gazebo/
โ โโโ worlds/
โ โโโ models/
โ โโโ launch/
โ โโโ CMakeLists.txt
โโโ README.md
-
OS: Ubuntu 22.04 LTS
-
ROS 2: Humble Hawksbill
-
Simulator: Gazebo 11+
-
Python: 3.10+
-
Required Packages:
turtlebot3cartographer_rosnavigation2
1๏ธโฃ Clone the repository
cd ~/
git clone <repository-url> ps1_ws
cd ps1_ws2๏ธโฃ Add environment variables to ~/.bashrc
export TURTLEBOT3_MODEL=waffle
export RMW_IMPLEMENTATION=rmw_cyclonedx_cpp
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/ps1_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models
export GAZEBO_RESOURCE_PATH=$GAZEBO_RESOURCE_PATH:~/ps1_ws/src
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:~/ps1_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models3๏ธโฃ Reload your terminal
source ~/.bashrc4๏ธโฃ Install dependencies
rosdep update
rosdep install --from-paths src --ignore-src -r -y5๏ธโฃ Build the workspace
colcon build --symlink-install
source install/setup.bashros2 launch turtlebot3_gazebo turtlebot3_house.launch.pyros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=Trueros2 run turtlebot3_teleop teleop_keyboardTeleop Controls:
w = forward | s = backward | a = left | d = right | x = stop | Space = emergency stop
ros2 run nav2_map_server map_saver_cli -f ~/mapros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True map:=$HOME/map.yamlros2 launch turtlebot3_autonomous_exploration autonomous_exploration.launch.pyLocation: src/turtlebot3/turtlebot3_cartographer/config/turtlebot3_lds_2d.lua
Key settings:
- ๐ Frames:
mapโodomโimu_link - ๐ Sensor: LDS Laser Scan, range 0.12mโ8.0m
- ๐ Submaps: 160 scans/submap @ 0.05m resolution
- ๐ Pose Graph: Loop closure every 90 nodes
Includes AWS RoboMaker residential models:
- Air Conditioners
- Furniture & rooms
- Realistic textures and collision meshes
- 2D Pose Estimate: Set initial pose
- 2D Nav Goal: Click to set a goal
- Monitor paths: Green (global) & Purple (local)
| Issue | Solution |
|---|---|
| Map frame missing | Use RViz 2D Pose Estimate |
| Goals fail | Set goals in free space only |
| Robot won't move | Verify use_sim_time & $TURTLEBOT3_MODEL |
| Missing models | Check $GAZEBO_MODEL_PATH |
| SLAM issues | Verify /scan topic & TF tree |
โ
Tune num_range_data, hit_probability, miss_probability in turtlebot3_lds_2d.lua
โ
Keep visual meshes simple for faster Gazebo performance
โ
Use CycloneDX for robust ROS 2 communication
- Add models:
models/folder โmodel.sdf+model.config+ meshes - Update CMake: Add new plugins or worlds as needed
- Test configs: Edit
.luaโ rebuild โ test in sim
Apache License 2.0 โ see LICENSE.
Special thanks to:
- ROBOTIS TurtleBot3
- Google Cartographer
- Nav2
- Gazebo simulation team
๐ References:
Author: Anish Kumar GitHub: @anishk85
โจ Enjoy mapping & navigating with your TurtleBot3!

