Skip to content

AswinprabhuM/multi_map_nav_ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧭 Multi-Map Navigation with Wormholes in ROS 1

Overview

This ROS package demonstrates a modular, action-based multi-map navigation system for a mobile robot that seamlessly transitions between independently mapped rooms (maps) using a mechanism called wormholes.

Key features:

  • Dynamic room-to-room navigation
  • SQL database to store wormhole data
  • Gazebo simulation and move_base navigation
  • Custom action server for multi-map goal handling
  • Automatic launch and shutdown of Gazebo + Nav Stack nodes

📌 Problem Statement

Design and implement a system where:

  • Each room is mapped separately.
  • A robot can navigate to any location across rooms.
  • A wormhole connects overlapping areas between rooms.
  • Robot autonomously:
    • Navigates to the wormhole,
    • Switches map and Gazebo world,
    • Continues navigation in the new room.

🗂️ Project Structure

multi_map_navigator/
├── action/
│ └── NavigateBetweenMaps.action
├── maps/
│ ├── room_a.yaml
│ └── room_b.yaml
├── world/
│ ├── room_a.world
│ └── room_b.world
├── launch/
│ ├── amcl.launch
│ ├── move_base.launch
│ ├── my_world_loader.launch
│ └── my_navigation.launch
├── src/
│ ├── action_server.cpp
│ ├── action_client.cpp
│ ├── nav_controller.cpp
│ ├── map_manager.cpp
│ └── db_interface.cpp
├── include/
│ └── multi_map_navigator/
│ ├── nav_controller.hpp
│ ├── map_manager.hpp
│ └── db_interface.hpp
├── param/
│ ├── base_local_planner_params.yaml
│ ├── costmap_common_params_burger.yaml
│ ├── dwa_local_planner_params_burger.yaml
│ ├── global_costmap_params.yaml
│ ├── local_costmap_params.yaml
│ └── move_base_params.yaml
├── rviz/
│ └── turtlebot3_navigation.rviz
├── my_wormholes.db
├── CMakeLists.txt
└── package.xml

🧠 Architecture

Core Components:

  • action_server.cpp: Receives goal with pose + map ID, dispatches to NavController.
  • NavController: Handles logic to either:
    • Navigate directly if in the same map.
    • Go to wormhole, shutdown current world, launch new one, continue navigation.
  • db_interface: SQLite wrapper for reading wormhole positions.
  • map_manager: Publishes initial pose after map switch.

Inter-process Coordination:

  • Launch files for spawning Gazebo + navigation stack per map.
  • Wormholes act as bridges between maps.
  • Modular launch separation ensures extendability.

🚀 Execution Flow

  1. Client Node:

    • Starts my_world_loader.launch and my_navigation.launch.
    • Sends a NavigateBetweenMapsGoal to the server.
  2. Server (Action):

    • Checks if target map is same.
    • If not:
      • Moves to wormhole using move_base.
      • Kills current Gazebo and Nav stack.
      • Launches new world_file and map_file.
      • Sets initial pose via map_manager.
      • Sends final goal to move_base.
  3. Navigation is visualized in RViz.


⚙️ How to Run

cd ~/multi_map_nav_ws
catkin_make
source devel/setup.bash
rosrun multi_map_navigator navigate_between_maps_server
rosrun multi_map_navigator navigate_between_maps_client

📡 Wormhole DB Schema

my_wormholes.db contains:

CREATE TABLE wormholes (
  source_map TEXT,
  target_map TEXT,
  source_x REAL,
  source_y REAL,
  source_yaw REAL,
  target_x REAL,
  target_y REAL,
  target_yaw REAL
);

📋 Pseudocode (C++ Style)

handleNavigation(...)

if (target_map == current_map) {
    // Already in the desired map, send goal directly
    return sendGoal(target_pose);
}

// Step 1: Fetch wormhole details from SQLite DB
Wormhole wh = db.getWormhole(current_map, target_map);

// Step 2: Navigate to the wormhole pose in current map
sendGoal(wh.source_pose);

// Step 3: Kill old Gazebo and Navigation nodes
killGazeboAndNavStack();

// Step 4: Launch new world and map
launchNewWorld(target_map);
launchNavStack(target_map);

// Step 5: Set initial pose in new map using wormhole target
map_mgr.setInitialPose(wh.target_x, wh.target_y, wh.target_yaw);

// Step 6: Wait for new move_base to come up
waitForMoveBase();

// Step 7: Send final goal in the new map
return sendGoal(target_pose);

📋 Pseudocode – sendGoal(...)

// Connect to move_base action server
wait for move_base;

// Send the goal
send goal;

// Wait for result
wait for result;

// Return outcome
if (success)
    return true;
else
    return false;

📊 Trajectory Handling

Collection:

Trajectories generated by move_base can be recorded using:

rosbag record /odom /move_base/TrajectoryPlannerROS/global_plan /tf

Storage

  • Navigation is dynamic and reactive.
  • Paths are computed live by move_base.
  • No pre-defined or statically stored trajectories are used.

Visualization (RViz)

  • View real-time robot movement
  • Set initial pose (/initialpose)
  • Send navigation goals (2D Nav Goal)
  • Track coordinate frames (/tf)
  • Observe global and local planned paths in RViz

✅ Modularity & OOP Principles

  • All core functionality is modular and separated into:
    • NavController: Handles decision flow and control logic.
    • DBInterface: Interfaces with the SQLite wormhole database.
    • MapManager: Publishes initial pose after map switch.
  • ROS parameters, file paths, and topic names are externally configurable.
  • To add new maps:
    • Just create new .yaml, .world, and a DB entry — no code change needed.

📦 Dependencies

  • ROS Noetic
  • move_base, amcl, map_server
  • gazebo_ros, turtlebot3_description
  • SQLite3 (system library)
sudo apt-get install libsqlite3-dev sqlite3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors