Skip to content

Commit 7482746

Browse files
committed
reorganize docs
1 parent 0cf5c04 commit 7482746

File tree

3 files changed

+101
-21
lines changed

3 files changed

+101
-21
lines changed

docs/source/ros2api.rst

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,8 @@ or LiDAR-odometry module. At present, this applies to:
1111
MOLA modules and the ROS 2 system.
1212
- :ref:`mola_lidar_odometry`
1313

14-
.. note::
15-
16-
It is recommended to start with the tutorial on how to :ref:`build a map <building-maps>`,
17-
then check out :ref:`how to launch MOLA-LO for ROS 2 <mola_lo_ros>`.
18-
1914
.. image:: https://mrpt.github.io/imgs/mola-lo-ros2-launch-demo-kitti.png
2015

21-
22-
2316
____________________________________________
2417

2518
.. contents:: Table of Contents
@@ -31,7 +24,32 @@ ____________________________________________
3124

3225
|
3326
34-
1. Map loading / saving
27+
1. Launching MOLA-LO ROS 2 node
28+
--------------------------------------
29+
30+
Basic usage:
31+
32+
.. code-block:: bash
33+
34+
# Basic usage (requires correct LiDAR sensor /tf):
35+
ros2 launch mola_lidar_odometry ros2-lidar-odometry.launch.py \
36+
lidar_topic_name:=/ouster/points
37+
38+
# Usage without sensor /tf:
39+
ros2 launch mola_lidar_odometry ros2-lidar-odometry.launch.py \
40+
lidar_topic_name:=/ouster/points \
41+
ignore_lidar_pose_from_tf:=True
42+
43+
.. note::
44+
45+
It is recommended to start with the tutorial on how to :ref:`build a map <building-maps>`,
46+
then read :ref:`the docs <mola_lo_ros>` on the MOLA-LO ROS 2 launch file.
47+
48+
|
49+
50+
----
51+
52+
2. Map loading / saving
3553
--------------------------------------
3654
During a live SLAM run, ``BridgeROS2`` will look for modules implementing
3755
:ref:`MapServer <doxid-classmola_1_1_map_server>` and will expose
@@ -43,13 +61,13 @@ these **ROS 2 services** to load or save the current map:
4361

4462
.. dropdown:: Example ROS 2 cli service calls
4563

46-
To save the current map:
64+
To save the current map:
4765

4866
.. code-block:: bash
4967
5068
ros2 service call /map_save mola_msgs/srv/MapSave "map_path: '/tmp/my_map_file_prefix'"
5169
52-
To load a map from disk:
70+
To load a map from disk:
5371

5472
.. code-block:: bash
5573
@@ -70,7 +88,7 @@ the corresponding checkbox in the
7088
7189
----
7290

73-
2. Re-localization
91+
3. Re-localization
7492
--------------------------------------
7593
Write me!
7694

@@ -80,7 +98,7 @@ Write me!
8098

8199
.. _mola_ros2_tf_frames:
82100

83-
3. ``/tf`` frames
101+
4. Published ``/tf`` frames
84102
--------------------------------------
85103
These frames of reference exist when using MOLA :ref:`geo-referenced <geo-referencing>` maps:
86104

@@ -116,7 +134,7 @@ And this is who is responsible of publishing each transformation:
116134

117135
----
118136

119-
4. Map publishing
137+
5. Map publishing
120138
--------------------------------------
121139
There are two ways of publishing maps to ROS:
122140

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. _tutorial-mola-lo-map-and-localize:
2+
3+
===============================================
4+
MOLA-LO: Build a map and then localize
5+
===============================================
6+
7+
This tutorial will show you how to build a map using MOLA-LO, then save the map to disk,
8+
and how to load that map to use the LO localization mode.
9+
10+
.. contents::
11+
:depth: 1
12+
:local:
13+
:backlinks: none
14+
15+
|
16+
17+
MOLA installation
18+
----------------------------------
19+
This tutorial requires the installation of these MOLA packages: ``mola_demos``, ``mola_viz``.
20+
21+
Following the default :ref:`installation instructions <installing>` is enough.
22+
23+
It also uses the MVSim simulator, although a live robot or LiDAR sensor can be used instead.
24+
25+
|
26+
27+
Create a map and save it
28+
----------------------------------
29+
30+
Open three (3) terminals, and run these commands in each one:
31+
32+
In terminal #1, launch the simulator (or your custom launch for your real sensor):
33+
34+
.. code-block:: bash
35+
36+
ros2 launch mvsim demo_warehouse.launch.py \
37+
do_fake_localization:=False \
38+
with_rviz:=False
39+
40+
|
41+
42+
In terminal #2, launch MOLA-LO, enabling saving the map in simple-map format:
43+
44+
.. code-block:: bash
45+
46+
MOLA_GENERATE_SIMPLEMAP=true \
47+
ros2 launch mola_lidar_odometry ros2-lidar-odometry.launch.py \
48+
lidar_topic_name:=/lidar1_points
49+
50+
.. note::
51+
52+
Remember replacing ``/lidar1_points`` with your actual PointCloud2 topic with raw LiDAR data.
53+
54+
Next, move the robot around. In the simulator, you can click on the MVSim GUI and use keys ``asdw`` to drive around, or use a gamepad.
55+
56+
|
57+
58+
Once the map looks OK in the mola_viz GUI, let's save it.
59+
In terminal #3, run:
60+
61+
.. code-block:: bash
62+
63+
ros2 service call /map_save mola_msgs/srv/MapSave "map_path: '/tmp/my_map'"
64+

docs/source/tutorials.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
Tutorials
55
=============
66

7-
.. note::
8-
9-
This page refers to core MOLA packages. For higher-level SLAM tutorials,
10-
refer to: :ref:`building-maps`.
117

8+
.. toctree::
9+
:maxdepth: 2
10+
:caption: SLAM, mapping, localization
1211

13-
These pages gives use-case examples of how to make the existing MOLA modules
14-
work, how to extend them to create new ones, and how to use the auxiliary MOLA
15-
tools.
12+
building-maps
13+
tutorial-mola-lo-map-and-localize
1614

17-
(Write me!)
1815

1916
.. toctree::
2017
:maxdepth: 2
18+
:caption: Core MOLA functionalities
2119

2220
tutorial-mola-main-cli-tools
2321
tutorial-mola-cmake-commands

0 commit comments

Comments
 (0)