Skip to content
MohitShridhar edited this page Aug 26, 2014 · 29 revisions

Overview

It's recommended that you read the original wiki before continuing with the setup.

tl;dr summary: this package allows you to create a database of static-maps and preload them during launch. Upon request, you can transition to a desired map from the database. Each map can have multiple 'wormholes', which are defined as the points of transition between maps. During setup, you can list a wormhole as the corresponding link between two or more maps. So when you set navigation goals, you need to provide an additional parameter 'map_name' along with the x-y coordinates of the desired target. If the robot isn't currently in the desired map, the multi_map_navigation_manager will set the move_base target to a wormhole, which eventually leads to the target map. What happens if there are multiple wormholes leading to the same map? Upon initialization, the manager constructs a graph of all the available wormholes and uses Dijkstra's algorithm to find the shortest path to the destination.

Map Database

Managing Static-Maps

The dependency map_store uses MongoDB to store & load static-maps. Have a look at 'MongoDB Installation' and setup your data directory (eg: /data/db). Then run the database server:

$ sudo mongod

Before using the multi-map manager, you must ensure that the master-system's database contains all the necessary maps required for the navigation task. You cannot add new maps or wormholes during navigation (for now). After compiling the multi_map_navigation package, you should be able to see two newly available panels named Navigator and MapManager under Panel->Add New Panel in Rviz. We will use MapManager for setting up the master database.

Launch the settings file & load MapManager on Rviz:

$ roslaunch multi_map_navigation map_settings.launch
$ roscd multi_map_navigation/rviz/
$ rosrun rviz rviz -d map_settings.rviz

If the map_settings.rviz config file doesn't work, restart Rviz and add the MapManager panel manually and subscribe to the topics indicated in the file. Follow this video to add, delete or rename YAML map files (which have their corresponding pgm files in the same directory). The video also shows you how to align maps with the Rviz-GUI tools. Although you can specify the dump coordinates (i.e., the spawn coordinates of the robot in the new map after a transition) in the configuration file, it's recommended that you align the maps to make the navigation setup more intuitive and assist other utilities like AMCL to adjust easily to transistions.

Multiple Robots

If you are controlling multiple robots simultaneously, then each robot needs to have a seperate copy of the map-database.

database

In your move_base launch file, you should first initialize the map-database server:

<include file="$(find multi_map_navigation)/launch/setup/mongodb_server.launch">
    <arg name="host" value="localhost"/>
    <arg name="port" value="27017"/>
    <arg name="db_overwrite" value="true"/>
    <arg name="db_location" value="warehouse_data"/>
</include>

Then properly namespace each copy of map_store:

<group ns="robot0">
...
    <include file="$(find multi_map_navigation)/launch/setup/map_store.launch">
      <arg name="frame_id_ref" value="robot0/map"/>
    </include>
...
</group>

<group ns="robot1">
...
    <include file="$(find multi_map_navigation)/launch/setup/map_store.launch">
      <arg name="frame_id_ref" value="robot1/map"/>
    </include>
...
</group>

Configuration

Elevator-Setup Example:

start_map: Floor_Basement
maps:
     - name: Floor_Basement
       north_angle: 0.0
     - name: Floor_1
       north_angle: 0.0
     - name: Floor_2
       north_angle: 0.0

wormholes:
     - name: elevator1 # for Gazebo simulation, this should be same as the spawn model name
       type: elevator_blast
       radius: 0.2
       locations:
            - map: Floor_Basement 
              position: [9.475, 16.346] # dump coordinates
              waiting_point: [14.382 16.130 3.132] # x, y, yaw 
              floor: 0 
              height: 0.0 # not used, but might be useful in the future to calculate the cost of using the elevator
            - map: Floor_1
              position: [9.475, 16.346]
              waiting_point: [4.687 16.517 3.135]
              floor: 1
              height: 2.0
            - map: Floor_2
              position: [9.475, 16.346]
              waiting_point: [4.687 16.517 3.135]
              floor: 2
              height: 4.0

The original stack has sufficient details on creating this configuration file. The only additional parameters are waiting_point & floor, both of which are specific to the elevator_blast transition. Before heading to elevator, the navigation manager will command the robot to goto the waiting area so that it can interact with the elevator controls. The floor parameter will be used to set target floors based on the specifications of elevator-controller. You will need this configuration file later on when spawning the multi_map_navigation_manager.py node in your move_base launch file.

Clone this wiki locally