Repository navigation
Topological Navigation 2
This page describes the architecture of the ROS 2 implementation. For parameters, topics, services and actions see the repository README.
flowchart LR
MM[map_manager2] -- /topological_map_2 --> LOC[localisation2]
MM -- /topological_map_2 --> NAV[navigation2]
LOC -- current_node, closest_node, closest_edges --> NAV
NAV -- action goals --> NAV2[Nav2 or fake_nav2_server]
MM -- /topological_map_2 --> VIS[map visualiser, web app]
NAV -- Route, current_edge, status --> VIS
VIS -- GotoNode goal --> NAV
-
Map manager (
map_manager2.py) loads a.tmap2.yaml/.tmap3.yamlmap, validates it againstconfig/tmap-schema.yaml, publishes it as a latchedstd_msgs/Stringon/topological_map_2and broadcasts a static TF fromtransformation.parenttotransformation.topo_frame_id. -
Localisation (
localisation2.py) builds a NetworkX graph with a KD-tree, looks uptopo_frame_id -> base_framein TF once per second and publishes/current_node(inside an influence zone, otherwisenone),/closest_node,/closest_node_distance,/closest_edgesand/current_node/tag. -
Navigation (
navigation2.py) serves theGotoNodeaction on/topological_navigation. It plans a route (A* or Dijkstra), merges consecutive composable edges of the same action into segments, builds a goal for each segment from the map's action template and sends it to the matching action server (Nav2). Statistics are published and, ifstats_db_pathis set, stored in SQLite. -
Visualiser and web app render the map and route, and send
GotoNodegoals on click.
navigation_graph.py provides NavState and NavStateMachine; navigation2.py waits for the map and for localisation, then moves to READY. The state is published as text on /robot_operation_current_status.
Actions are not hard coded. The actions section of the map (or of a sidecar topological_navigation_config.yaml) defines, per action name, the ROS action type, the action server, whether consecutive edges can be composed into a single goal, and a goal template with ${node.*}, ${transformation.*} and ${definitions.*} placeholders. See Topological YAML Format.
Parameters of other ROS nodes (for example the Nav2 goal checker or collision monitor) can be changed for the duration of a segment with ros_parameters and set_ros_params; see doc/SET_ROS_PARAMS.md.
topological_navigation/ core package
topological_navigation/
scripts/ ROS nodes and CLI entry points
map_manager2.py localisation2.py navigation2.py
map_recorder.py manual_topomapping.py topo_stats.py
navigation_graph.py state machine, route planning, segment merging, boundary polygons
networkx_utils.py graph construction, KD-tree, point-in-polygon, localisation logic
tmap_utils.py map loading (including sidecar config), saving
map_recorder_utils.py pure Python map building core
map_analyser.py map_merger.py validate_map.py convert_tmap.py
nav_stats_db.py coverage_analysis.py topomap_to_map_image.py
config/ schemas, node/edge/action templates, sample maps
launch/ rviz/ doc/ test/
topological_navigation_msgs/ msg, srv, action
topological_navigation_visual/ visualiser, route visualiser, web app, policy markers
topological_nav_simulator/ fake Nav2 server and virtual robot