8000 GitHub - anishk85/TurtleBot3-Simulation
[go: up one dir, main page]

Skip to content

anishk85/TurtleBot3-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐Ÿค– TurtleBot3 Simulation Workspace

๐ŸŽฅ Demo Videos

TurtleBot3 Simulation Demo
TurtleBot3 Simulation Demo

TurtleBot3 Autonomous Exploration
TurtleBot3 Autonomous Exploration

Watch TurtleBot3 autonomously explore, map, and navigate a custom house simulation!


๐Ÿ—‚๏ธ Workspace Overview

This workspace provides TurtleBot3 simulation packages for ROS 2, including:

  • Gazebo simulation
  • Google Cartographer SLAM
  • Custom world models
  • Autonomous exploration with explore_lite

๐Ÿ“Œ Features

โœ… 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


๐Ÿ—‚๏ธ Workspace Structure

ps1_ws/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ turtlebot3/
โ”‚   โ”‚   โ””โ”€โ”€ turtlebot3_cartographer/
โ”‚   โ”‚       โ””โ”€โ”€ config/
โ”‚   โ”‚           โ””โ”€โ”€ turtlebot3_lds_2d.lua
โ”‚   โ””โ”€โ”€ turtlebot3_simulations/
โ”‚       โ””โ”€โ”€ turtlebot3_gazebo/
โ”‚           โ”œโ”€โ”€ worlds/
โ”‚           โ”œโ”€โ”€ models/
โ”‚           โ”œโ”€โ”€ launch/
โ”‚           โ””โ”€โ”€ CMakeLists.txt
โ””โ”€โ”€ README.md

โš™๏ธ Prerequisites

  • OS: Ubuntu 22.04 LTS

  • ROS 2: Humble Hawksbill

  • Simulator: Gazebo 11+

  • Python: 3.10+

  • Required Packages:

    • turtlebot3
    • cartographer_ros
    • navigation2

๐Ÿ“ฅ Installation

1๏ธโƒฃ Clone the repository

cd ~/
git clone <repository-url> ps1_ws
cd ps1_ws

2๏ธโƒฃ 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/models

3๏ธโƒฃ Reload your terminal

source ~/.bashrc

4๏ธโƒฃ Install dependencies

rosdep update
rosdep install --from-paths src --ignore-src -r -y

5๏ธโƒฃ Build the workspace

colcon build --symlink-install
source install/setup.bash

๐Ÿš€ How to Use

๐Ÿ  Launch the Custom House Simulation

ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py

๐Ÿ—บ๏ธ Start SLAM with Cartographer

ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True

๐ŸŽฎ Teleop Drive for Mapping

ros2 run turtlebot3_teleop teleop_keyboard

Teleop Controls: w = forward | s = backward | a = left | d = right | x = stop | Space = emergency stop

๐Ÿ’พ Save the Map

ros2 run nav2_map_server map_saver_cli -f ~/map

๐Ÿงญ Launch Autonomous Navigation

ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True map:=$HOME/map.yaml

๐Ÿค– Fully Autonomous Exploration with Explore Lite

ros2 launch turtlebot3_autonomous_exploration autonomous_exploration.launch.py

๐Ÿงฉ Key Configuration

๐Ÿ“„ Cartographer Config

Location: 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

๐Ÿ—ƒ๏ธ Gazebo Models

Includes AWS RoboMaker residential models:

  • Air Conditioners
  • Furniture & rooms
  • Realistic textures and collision meshes

๐ŸŽฏ RViz Controls

  • 2D Pose Estimate: Set initial pose
  • 2D Nav Goal: Click to set a goal
  • Monitor paths: Green (global) & Purple (local)

๐Ÿž Troubleshooting

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

โš™๏ธ Performance Tips

โœ… 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


๐Ÿงฉ Development

  • 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

๐Ÿ“œ License

Apache License 2.0 โ€” see LICENSE.


โœจ Acknowledgments

Special thanks to:

  • ROBOTIS TurtleBot3
  • Google Cartographer
  • Nav2
  • Gazebo simulation team

๐Ÿ“š References:


๐Ÿ™Œ Contact

Author: Anish Kumar GitHub: @anishk85


โœจ Enjoy mapping & navigating with your TurtleBot3!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0