LCAS / topological_navigation

The topological navigation framework
Apache License 2.0
32 stars 36 forks source link

visualise_map with non-global topological_navigation instance does not work without the -e arg #11

Closed heuristicus closed 4 years ago

heuristicus commented 4 years ago

Currently running the topological map visualisation as in topo_nav_global.launch

<node pkg="topological_navigation" type="visualise_map.py" name="visualise_map" args="$(arg map)" respawn="true"/>

Assumes that there is a single topological navigation instance available at /topological_navigation when instantiating the go_to_node service.

When running multiple robots, a possible configuration is running the topo_nav_global to manage the map which the robots will use for navigation, but each one has its own topological_navigation instance to actually traverse the map. If visualise_map is run without the -e or -edit args, only the edge, marker and zone interactive markers will be available (i.e. the editable ones), and the non-editable lines and waypoint markers will not show up because goto.py will wait on the topological_navigation actionserver which will never become active.

There two obvious solutions:

  1. Add a timeout to the wait at https://github.com/LCAS/topological_navigation/blob/master/topological_navigation/src/topological_navigation/goto.py#L32 and print an error.
  2. Add an arg to launch files where visualise_map is being used so that the -edit arg can be added and skip the go_to_node service creation.

This would also require a separate go_to_node script so that the service can be started for each topological_navigation instance, but this is a tiny script (probably):

#!/usr/bin/env python

import rospy
from topological_navigation.goto import *

if __name__ == '__main__':
    rospy.init_node("go_to_node")

    goto_cont = go_to_controllers()

    rospy.spin()

This would be run something like

rosrun topological_navigation go_to_node.py __ns:=/robot_0

or

<node pkg="topological_navigation" type="go_to_node.py" name="go_to_node" ns="robot_0"/>

from a launch file

This is a relatively small issue but at the moment it's not obvious why the visualisation doesn't appear.