Skip to content
Alex-TerletskyPublic

About

Autonomous navigation and dynamic obstacle avoidance for TurtleBot3 in ROS 2.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

robo-sim

Overview

An autonomous ROS 2 navigation stack for the TurtleBot3 Waffle in Gazebo that integrates SLAM-based mapping, Nav2 path planning, and predictive avoidance of dynamic obstacles. Uses a C++ perception pipeline (DBSCAN clustering, Hungarian data association, constant-velocity Kalman filter) to track moving obstacles from LiDAR and a custom Nav2 costmap plugin to inflate cost along their predicted trajectories.

ROS 2 Jazzy · C++ · Gazebo Harmonic · Nav2 · SLAM Toolbox · AMCL · TF2 · pluginlib · DBSCAN · Hungarian algorithm · Kalman filter · Eigen3

Components

All packages live under src/.

  • reactive_avoider (C++) — Standalone sector-based reactive controller. Subscribes to /scan and publishes /cmd_vel on a 20 Hz timer, stopping and rotating when obstacles enter a configurable forward safety arc.
  • dynamic_obstacle_tracker (C++) — Multi-object LiDAR tracker. Pipeline: DBSCAN segmentation of /scan returns → Hungarian assignment of clusters to existing tracks → per-track Kalman filter (constant-velocity model). Publishes /tracked_obstacles (custom TrackedObstacleArray message with position, velocity, and covariance) and a MarkerArray for RViz.
  • predictive_costmap_layer (C++) — Nav2 costmap plugin registered via pluginlib. Consumes /tracked_obstacles and inflates cost along each obstacle's predicted trajectory, so Nav2's planner routes around where obstacles will be, not just where they are. Loaded into the layered costmap alongside the static and obstacle layers.
  • avoidance_bringup — Launch orchestration, Nav2 and SLAM Toolbox parameter YAML, RViz configs, maps, and Gazebo SDF models (including a moving obstacle for exercising the predictive pipeline).

Quickstart

Prerequisites

  • Ubuntu 24.04
  • ROS 2 Jazzy with Gazebo Harmonic
  • TurtleBot3 and Nav2 packages:
    sudo apt install ros-jazzy-turtlebot3* ros-jazzy-nav2-bringup \
                     ros-jazzy-slam-toolbox ros-jazzy-ros-gz
  • export TURTLEBOT3_MODEL=waffle

Build

cd robo-sim
colcon build --symlink-install
source install/setup.bash

Run

Open four terminals; re-source install/setup.bash in each.

# Terminal 1 — Gazebo simulator with TurtleBot3 Waffle
ros2 launch avoidance_bringup sim.launch.py

# Terminal 2 — SLAM Toolbox (online mapping)
ros2 launch avoidance_bringup slam.launch.py

# Terminal 3 — Nav2 with the predictive costmap layer
ros2 launch avoidance_bringup nav.launch.py

# Terminal 4 — spawn a moving obstacle to exercise the tracker
ros2 launch avoidance_bringup spawn_moving_box.launch.py

Send a goal via the Nav2 Goal tool in RViz.

To run the standalone reactive avoider instead of the full Nav2 stack:

ros2 run reactive_avoider reactive_avoider

Repository layout

src/
├── avoidance_bringup/          # launch files, params, maps, RViz, SDF models
├── reactive_avoider/           # standalone reactive obstacle avoidance node
├── dynamic_obstacle_tracker/   # LiDAR-based multi-object tracker
└── predictive_costmap_layer/   # Nav2 costmap plugin consuming tracked obstacles
docs/                           # design notes and references

About

Autonomous navigation and dynamic obstacle avoidance for TurtleBot3 in ROS 2.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages