Skip to content

Commit 47f21ae

Browse files
Tutorial for Nav2 Route Tool (#633)
* initial route tool tutorial development Signed-off-by: John Chrosniak <chrosniakj@gmail.com> * finished first draft of route tool tutorial Signed-off-by: John Chrosniak <chrosniakj@gmail.com> * updated overview and fixed broken link Signed-off-by: John Chrosniak <chrosniakj@gmail.com> replaced external tutorial link with internal link fixed spelling --------- Signed-off-by: John Chrosniak <chrosniakj@gmail.com>
1 parent c73ed85 commit 47f21ae

File tree

8 files changed

+100
-0
lines changed

8 files changed

+100
-0
lines changed
2.67 MB
Loading
1.65 MB
Loading
1.32 MB
Loading
2.33 MB
Loading
5.48 MB
Loading
40.5 MB
Loading
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
.. _navigation2_route_tool:
2+
3+
Using the Nav2 Route Tool
4+
*************************
5+
6+
- `Overview`_
7+
- `Prerequisites`_
8+
- `Tutorial Steps`_
9+
10+
.. image:: images/Navigation2_route_tool/route_tool_demo.gif
11+
:width: 90%
12+
:align: center
13+
14+
Overview
15+
========
16+
17+
The Nav2 route tool is an Rviz panel designed to ease the process of creating and editing the route graphs used by the Nav2 Route Server.
18+
In contrast to a free-space planner, route graphs provided a structure path for mobile robots to follow when navigating through their environment.
19+
Supported operations for the route tool include loading in existing route graphs, adding new nodes and edges, editing existing nodes and edges, removing nodes and edges, and saving changes to a new file.
20+
By the end of this tutorial, you should feel comfortable creating and modifying route graphs using the route tool.
21+
22+
Prerequisites
23+
============
24+
25+
Prior to using the route tool, you will need to create an occupancy grid map using the slam_toolbox package.
26+
Follow `this tutorial <https://docs.nav2.org/tutorials/docs/navigation2_with_slam.html>`_ for instructions on how to generate and save an occupancy grid map.
27+
28+
Tutorial Steps
29+
==============
30+
31+
To start the route tool, open a terminal and run the command:
32+
33+
.. code-block:: bash
34+
35+
ros2 launch nav2_rviz_plugins route_tool.launch.py yaml_filename:=/path/to/map.yaml
36+
37+
This should open Rviz with the route tool panel on the left side and your occupancy grid map displayed in the center.
38+
39+
Loading a Route Graph
40+
---------------------
41+
42+
.. image:: images/Navigation2_route_tool/route_load.gif
43+
:width: 90%
44+
:align: center
45+
46+
To load in an existing route graph, click on the load button on the bottom left of the route tool panel.
47+
This will open up a file explorer so you can navigate to the existing geojson file you would like to load.
48+
After clicking open, you should see the route graph overlaid with your occupancy grid map.
49+
50+
Adding Nodes and Edges
51+
----------------------
52+
53+
.. image:: images/Navigation2_route_tool/route_add.gif
54+
:width: 90%
55+
:align: center
56+
57+
To add nodes and edges to your route graph, select the "Add" tab of the route tool panel.
58+
You can then add nodes by selecting the "Node" option and specifying coordinates for the new node.
59+
Coordinates can be specified manually or by using the "Publish Point" feature in Rviz.
60+
Once you have coordinates selected, click the "Create" button to add the node to your route graph.
61+
For edges, follow the same process with the "Edge" option selected and specifying the ID for the starting and ending node you wish to connect.
62+
63+
Editing Nodes and Edges
64+
-----------------------
65+
66+
.. image:: images/Navigation2_route_tool/route_edit.gif
67+
:width: 90%
68+
:align: center
69+
70+
To edit an existing node or edge, select the "Edit" tab of the route tool panel.
71+
You can edit an existing node by selecting the "Node" option, entering the ID of the node you wish to edit, and specifying the new coordinates for the node.
72+
Similar to adding in a node, you can enter these coordinates manually or using the "Publish Point" feature.
73+
After clicking the "Confirm" button, you should see the location of the node move.
74+
If the node has any edges connecting to it, those will be adjusted as well.
75+
Existing edges can be edited by selecting the "Edge" option, entering the ID of the edge you wish to edit, and specifying the IDs for the new starting and ending nodes.
76+
77+
Removing Nodes and Edges
78+
------------------------
79+
80+
.. image:: images/Navigation2_route_tool/route_delete.gif
81+
:width: 90%
82+
:align: center
83+
84+
To remove an existing node or edge, select the "Remove" tab of the route tool panel.
85+
Select the "Node" option if you would like to remove a node and the "Edge" option if you would like to remove an edge.
86+
Then enter the ID of the graph element you wish to remove and click the "Delete" button to remove it from the route graph.
87+
If you remove a node that has edges attached to it, those edges will be removed as well.
88+
You may need to toggle the visibility of the route graph in Rviz to see the change take effect.
89+
90+
Saving a Route Graph
91+
--------------------
92+
93+
.. image:: images/Navigation2_route_tool/route_save.gif
94+
:width: 90%
95+
:align: center
96+
97+
Once you are ready to save your route graph, click the "Save" button at the bottom right of the panel.
98+
This will then open a file explorer so you can specify where you would like to save your graph as a geojson file.
99+
After entering in a filepath and clicking "Save", your route graph should be ready for use with the Nav2 route server!

tutorials/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Nav2 Tutorials
1515
docs/using_groot.rst
1616
docs/integrating_vio.rst
1717
docs/navigation2_dynamic_point_following.rst
18+
docs/navigation2_route_tool.rst
1819
docs/navigation2_with_keepout_filter.rst
1920
docs/navigation2_with_speed_filter.rst
2021
docs/using_docking.rst

0 commit comments

Comments
 (0)