|
| 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