Skip to content

Commit fcacd37

Browse files
author
Murilo Marinho
committed
[navigation] Creating usage.
1 parent ee1f9aa commit fcacd37

File tree

4 files changed

+56
-4
lines changed

4 files changed

+56
-4
lines changed

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ If you enjoyed this tutorial, please
232232

233233
navigation/index
234234
navigation/installation
235+
navigation/usage
235236

236237

237238
Disclaimers

docs/source/navigation/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ so far in :program:`ROS2` will allow us to understand and interact with ``nav2``
2222
Nonetheless, there are sizable tutorials dedicated exclusively to navigation. This will not be the case here. The
2323
focus will be on linking the concepts learned so far and showcasing how they can be combined to interact with existing
2424
packages from the community. Conceptually, interacting with existing packages should be easy. However, going beyond
25-
using existing examples will require, possibly, all the knowledge acquired in previous sections.
25+
using existing examples will require, possibly, all the knowledge acquired in previous sections.
2626

2727
For illustrative purposes, we will also use the ``slam_toolbox``, meant for simultaneous localisation and mapping (SLAM).
2828
Whenever a concept from SLAM coincides with a navigation topic, this will be highlighted. However, going into detail

docs/source/navigation/installation.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ Installation
1111

1212
Official documentation: https://docs.nav2.org/getting_started/index.html
1313

14+
We will install ``nav2``, a few example packages, and the ``slam-toolbox`` with the following command.
15+
1416
.. rli:: https://raw.githubusercontent.com/UoMMScRobotics/SFR_Gazebo/refs/heads/main/install_nav2.sh
1517
:language: bash
1618
:lines: 5-14
1719

1820
The package ``ros-jazzy-navigation2`` contains most of ``nav2``. However, we have to install ``ros-jazzy-nav2-bringup``
19-
separately owing to "recursive dependencies". See below.
21+
separately owing to "recursive dependencies". See below all the packages that are installed with ``ros-jazzy-navigation2``.
2022

2123
.. dropdown:: Contents of ``ros-jazzy-navigation2``
2224

@@ -25,14 +27,15 @@ separately owing to "recursive dependencies". See below.
2527
:lines: 15-48
2628

2729
The last package related to ``nav2``, ``ros-jazzy-nav2-minimal-tb*`` has a wildcard that will expand, currently,
28-
to install the following packages.
30+
to install the following packages. These are optional packages that will give us some infrastructure to work on the
31+
tutorial.
2932

3033
- ros-jazzy-nav2-minimal-tb3-sim - Nav2 Minimum TurtleBot3 Simulation
3134
- ros-jazzy-nav2-minimal-tb4-description - Nav2's minimum Turtlebot4 Description package
3235
- ros-jazzy-nav2-minimal-tb4-sim - Nav2 Minimum TurtleBot4 Simulation
3336

3437
For illustrative purposes, we also add ``ros-jazzy-slam-toolbox``. Please note that navigation is complementary to
35-
localisation and mapping, but both can be done in isolation too.
38+
localisation and mapping. Both can be done in isolation too.
3639

3740
.. admonition:: References
3841

docs/source/navigation/usage.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Using ``nav2``
2+
==============
3+
4+
.. versionadded:: Jazzy
5+
6+
This section.
7+
8+
.. include:: ../the_topic_is_under_heavy_construction.rst
9+
10+
There is a plethora of online examples of ``nav2``, with varying levels of detail and quality. My approach will top-down,
11+
where we will see how illustrative examples and then walk through their contents.
12+
13+
Navigation on a known map
14+
+++++++++++++++++++++++++
15+
16+
.. seealso::
17+
18+
Official documentation: https://docs.nav2.org/tutorials/docs/navigation2_on_real_turtlebot3.html
19+
20+
In this example, our interest is looking at how navigation can be done with built-in tools, using a known *map*. A
21+
map will have many definitions and the literature about it is extensive. For now, we can think of the map as something
22+
usual. It points out where things are, where passable (such as roads) regions are, and possibly hazards and other
23+
relevant objects.
24+
25+
In this example, a `TurtleBot3 <https://www.turtlebot.com/turtlebot3/>`_ will be used. As part of ``nav2_bringup``, there
26+
is a rather complete example that we can utilize, namely :file:`tb3_simulation_launch.py`.
27+
28+
.. warning::
29+
30+
The ``sigterm_timeout`` flag is particularly important. Given that some devices we use might not be powerful enough
31+
for all processes to finish cleanly within 5 or 10 seconds, we should add this to prevent a ``SIGTERM`` from
32+
being sent to the nodes. If nodes are not terminated correctly they can leave connections open, linger indefinitely,
33+
and cause extremely difficult-to-debug situations. This can also be dangerous when real robots are used.
34+
35+
.. code-block:: console
36+
37+
ros2 launch nav2_bringup tb3_simulation_launch.py use_sim_time:=True headless:=False sigterm_timeout:=120
38+
39+
Navigation with SLAM
40+
++++++++++++++++++++
41+
42+
.. seealso::
43+
44+
Official documentation: https://docs.nav2.org/tutorials/docs/navigation2_with_slam.html#navigation2-with-slam
45+
46+
.. code-block:: console
47+
48+
ros2 launch nav2_bringup tb3_simulation_launch.py slam:=True sigterm_timeout:=120

0 commit comments

Comments
 (0)