Skip to content

JaisalJain/ros2-navigation-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS 2 Autonomous Navigation Stack for ROSbot

A complete autonomous navigation system built using ROS 2 Jazzy, Nav2, SLAM Toolbox, Gazebo, and Behavior Trees.

This project demonstrates:

  • Robot modeling and visualization
  • Gazebo simulation
  • 2D SLAM mapping
  • Autonomous navigation with Nav2
  • Goal-based navigation
  • Custom Nav2 applications
  • Behavior Tree based task execution
  • Groot2 integration for BT visualization

Prerequisites

sudo apt install ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-slam-toolbox

Packages

Package Description
rosbot_description ROSbot URDF, RViz visualization, and Gazebo simulation
rosbot_nav2_bringup Nav2 and SLAM Toolbox configuration
nav2_client Custom C++ Nav2 action client
nav2_bt_client Behavior Tree based navigation application

Build

source /opt/ros/jazzy/setup.bash

colcon build --symlink-install

source install/setup.bash

1. Robot Model Visualization

Launch the ROSbot model in RViz.

source install/setup.bash

ros2 launch rosbot_description display.launch.py

Result


2. Gazebo Simulation

Launch the robot inside the Gazebo simulation environment.

source install/setup.bash

ros2 launch rosbot_description gazebo.launch.py
  • Simulation world loads
  • ROSbot spawns in Gazebo
  • Sensors and robot controllers become active

Result


3. SLAM Mapping

Generate a 2D occupancy grid map using SLAM Toolbox.

Terminal 1

ros2 launch rosbot_description gazebo.launch.py

Terminal 2

ros2 launch rosbot_nav2_bringup slam_online_async.launch.py

Drive the robot around the environment to build the map.

Save Map

ros2 run nav2_map_server map_saver_cli -f ~/map

Result


4. Goal-Based Navigation

Perform autonomous navigation using Nav2.

Terminal 1

ros2 launch rosbot_description gazebo.launch.py

Terminal 2

ros2 launch rosbot_nav2_bringup nav2.launch.py

Steps

  1. Set the robot's initial pose using 2D Pose Estimate
  2. Select Nav2 Goal
  3. Send a navigation target

Result


5. NavigateToPose Action Client

Run a custom C++ Nav2 action client.

Terminal 1

ros2 launch rosbot_description gazebo.launch.py

Terminal 2

ros2 launch rosbot_nav2_bringup nav2.launch.py

Terminal 3

ros2 run nav2_client navigation_client

The application communicates with Nav2 using the NavigateToPose action interface.

Result


Navigation Scenario

The robot must autonomously visit multiple locations inside a hospital environment.

Mission Flow

  1. Start position
  2. Navigate to Medicine Shop
  3. Collect medicine
  4. Navigate to Room 1
  5. Deliver medicine
  6. Return to initial position

6. Behavior Tree Task Execution

Execute navigation tasks using a Behavior Tree based workflow.

Terminal 1

ros2 launch rosbot_description gazebo.launch.py

Terminal 2

ros2 launch rosbot_nav2_bringup nav2.launch.py

Set the robot's initial pose using 2D Pose Estimate.

Terminal 3

ros2 launch nav2_bt_client start_bt_app.launch.py

This launches:

  • Nav2 BT Action Client
  • Groot2
  • Behavior Tree execution engine
  • Real-time navigation monitoring
  • Robot navigation inside the environment

Result

Demo Video

bt_navigation.mp4

Technologies Used

  • ROS 2 Jazzy
  • Navigation2 (Nav2)
  • SLAM Toolbox
  • Gazebo Sim
  • RViz2
  • BehaviorTree.CPP
  • Groot2
  • C++
  • URDF

Repository Structure

.
├── docs
│   ├── images
│   └── videos
├── src
│   ├── rosbot_description
│   ├── rosbot_nav2_bringup
│   ├── nav2_client
│   └── nav2_bt_client
├── README.md
└── .gitignore

About

Complete ROS 2 navigation project featuring SLAM, localization, path planning, Nav2 action clients, and Behavior Trees.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors