Skip to content

Commit 30238b5

Browse files
committed
[skip ci] publish latest
Signed-off-by: fmrico <fmrico@gmail.com>
1 parent c7ec8d0 commit 30238b5

30 files changed

Lines changed: 6886 additions & 164 deletions

_images/base_icreate.jpg

5.24 MB
Loading

_images/rpi_icreate.jpg

3.41 MB
Loading

_sources/index.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
|LPN|
55
*****
66

7+
.. raw:: html
8+
9+
<h1 align="center">
10+
<div>
11+
<div style="position: relative; padding-bottom: 0%; overflow: hidden; max-width: 100%; height: auto;">
12+
<iframe width="450" height="300" src="https://www.youtube.com/embed/MssaLixuv2g?autoplay=1&mute=1" frameborder="1" allowfullscreen></iframe>
13+
<iframe width="450" height="300" src="https://www.youtube.com/embed/mxivTYNY1yY?autoplay=1&mute=1" frameborder="1" allowfullscreen></iframe>
14+
</div>
15+
</div>
16+
</h1>
17+
718
Overview
819
########
920

_sources/tutorials/easynav_costmap_stack/index.rst.txt

Lines changed: 401 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
.. mapping:
2+
3+
4+
Mapping with the Costmap Stack
5+
------------------------------
6+
7+
The mapping workflow with the ``easynav_costmap_stack`` mirrors the one used in the Simple Stack.
8+
For background and step-by-step context, see :doc:`the Simple Stack Mapping tutorial <../easynav_simple_stack/mapping>`.
9+
The main difference is that here the environment is represented internally as a graded **Costmap2D** instead of a
10+
binary occupancy grid.
11+
12+
Overview
13+
^^^^^^^^
14+
15+
1. **Generate a map** (e.g., using a SLAM solution). The output should be a **YAML + image** pair
16+
(``.yaml`` + ``.pgm/.png``) describing resolution, origin and free/occupied thresholds.
17+
2. **Place the map files** inside a package in your workspace. The Costmap Maps Manager will later load it
18+
using the pair of parameters ``package`` and ``map_path_file`` (you can also provide an absolute path).
19+
3. **Prepare an EasyNav parameters file**. In this tutorial we will use *dummy* plugins for controller,
20+
planner and localizer, and the **Costmap Maps Manager** to load and publish the map. This is enough to
21+
validate that the costmap is properly loaded and visualized.
22+
23+
Example parameters
24+
^^^^^^^^^^^^^^^^^^
25+
26+
Below is a minimal working configuration you can use to verify mapping. It mirrors the structure of the Simple Stack
27+
example but uses the Costmap-based maps manager. You may replace ``my_maps_pkg`` and the YAML path with your own.
28+
29+
.. code-block:: yaml
30+
31+
controller_node:
32+
ros__parameters:
33+
use_sim_time: true
34+
controller_types: [dummy]
35+
dummy:
36+
rt_freq: 30.0
37+
plugin: easynav_controller/DummyController
38+
cycle_time_nort: 0.01
39+
cycle_time_rt: 0.001
40+
41+
localizer_node:
42+
ros__parameters:
43+
use_sim_time: true
44+
localizer_types: [dummy]
45+
dummy:
46+
rt_freq: 50.0
47+
freq: 5.0
48+
reseed_freq: 0.1
49+
plugin: easynav_localizer/DummyLocalizer
50+
cycle_time_nort: 0.01
51+
cycle_time_rt: 0.001
52+
53+
maps_manager_node:
54+
ros__parameters:
55+
use_sim_time: true
56+
map_types: [costmap]
57+
costmap:
58+
freq: 10.0
59+
plugin: easynav_costmap_maps_manager/CostmapMapsManager
60+
package: my_maps_pkg
61+
map_path_file: maps/office.yaml
62+
63+
planner_node:
64+
ros__parameters:
65+
use_sim_time: true
66+
planner_types: [dummy]
67+
dummy:
68+
freq: 1.0
69+
plugin: easynav_planner/DummyPlanner
70+
cycle_time_nort: 0.2
71+
cycle_time_rt: 0.001
72+
73+
sensors_node:
74+
ros__parameters:
75+
use_sim_time: true
76+
forget_time: 0.5
77+
78+
system_node:
79+
ros__parameters:
80+
use_sim_time: true
81+
position_tolerance: 0.1
82+
angle_tolerance: 0.05
83+
84+
Running and visualizing
85+
^^^^^^^^^^^^^^^^^^^^^^^
86+
87+
1. Launch your simulator (or a static map server) and start EasyNav with the parameter file above.
88+
2. Open ``rviz2`` and add an *OccupancyGrid* display for the topic
89+
``maps_manager_node/<plugin_name>/map`` (static) or ``maps_manager_node/<plugin_name>/dynamic_map`` (dynamic).
90+
You should see the costmap as a grayscale image where darker values denote higher traversal cost.
91+
92+
Saving maps (SLAM Toolbox vs. Maps Manager)
93+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94+
95+
The Costmap Maps Manager reads and writes maps using the **same YAML + image format** as MoveBase/Nav2.
96+
That means you do *not* need to rely on the manager's internal save path if you are producing the map with SLAM Toolbox.
97+
98+
- **Option A (Maps Manager service):** The manager exposes a ``savemap`` service at
99+
``maps_manager_node/<plugin_name>/savemap`` which saves its current static map to the configured path.
100+
- **Option B (Recommended with SLAM Toolbox):** Call the SLAM Toolbox service
101+
``/slam_toolbox/save_map`` (service type ``slam_toolbox/srv/SaveMap``) directly. This will write the
102+
YAML + image pair in the standard format that the Costmap Maps Manager can later load with
103+
``package`` + ``map_path_file``.
104+
105+
.. note::
106+
107+
This tutorial is analogous to :doc:`../easynav_simple_stack/mapping`. The only conceptual change is the
108+
internal map representation (``Costmap2D`` with values 0–255 and obstacle inflation support) which allows
109+
subsequent components (planner/controller) to leverage graded costs instead of a hard free/occupied dichotomy.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
.. navigating:
2+
3+
Mapping with SLAM Toolbox and EasyNav
4+
-------------------------------------
5+
6+
7+
.. raw:: html
8+
9+
<h1 align="center">
10+
<div>
11+
<div style="position: relative; padding-bottom: 0%; overflow: hidden; max-width: 100%; height: auto;">
12+
<iframe width="450" height="300" src="https://www.youtube.com/embed/n1vDA4ZeG6M" frameborder="1" allowfullscreen></iframe>
13+
</div>
14+
</div>
15+
</h1>
16+
17+
Once the environment has been mapped, save the ``.map`` file in the directory of any package in your workspace.
18+
This will be required because we will later reference it using the package name and relative path.
19+
(Optionally, you can provide the absolute path through the parameter ``map_path_file``).
20+
21+
Next, create a parameter file for navigation.
22+
In this example we will use the **SeReST controller**, **AMCL** for robot localization, and specify that the ``maps_manager`` is an instance of ``easynav_simple_maps_manager/SimpleMapsManager``.
23+
In the corresponding section we define where the map is located and configure the laser as the sensor to be used:
24+
25+
.. code-block:: yaml
26+
27+
controller_node:
28+
ros__parameters:
29+
use_sim_time: true
30+
controller_types: [serest]
31+
serest:
32+
rt_freq: 30.0
33+
plugin: easynav_serest_controller/SerestController
34+
allow_reverse: true
35+
max_linear_speed: 0.8
36+
max_angular_speed: 1.2
37+
v_progress_min: 0.08
38+
k_s_share_max: 0.5
39+
k_theta: 2.5
40+
k_y: 1.5
41+
goal_pos_tol: 0.1
42+
goal_yaw_tol_deg: 6.0
43+
slow_radius: 0.80
44+
slow_min_speed: 0.02
45+
final_align_k: 2.5
46+
final_align_wmax: 0.8
47+
corner_guard_enable: true
48+
corner_gain_ey: 1.8
49+
corner_gain_eth: 0.7
50+
corner_gain_kappa: 0.4
51+
corner_min_alpha: 0.35
52+
corner_boost_omega: 1.0
53+
a_lat_soft: 0.9
54+
apex_ey_des: 0.05
55+
56+
localizer_node:
57+
ros__parameters:
58+
use_sim_time: true
59+
localizer_types: [simple]
60+
simple:
61+
rt_freq: 50.0
62+
freq: 5.0
63+
reseed_freq: 1.0
64+
plugin: easynav_simple_localizer/AMCLLocalizer
65+
num_particles: 100
66+
noise_translation: 0.05
67+
noise_rotation: 0.1
68+
noise_translation_to_rotation: 0.1
69+
initial_pose:
70+
x: 0.0
71+
y: 0.0
72+
yaw: 0.0
73+
std_dev_xy: 0.1
74+
std_dev_yaw: 0.01
75+
76+
maps_manager_node:
77+
ros__parameters:
78+
use_sim_time: true
79+
map_types: [simple]
80+
simple:
81+
freq: 10.0
82+
plugin: easynav_simple_maps_manager/SimpleMapsManager
83+
package: easynav_indoor_testcase
84+
map_path_file: maps/home.map
85+
86+
planner_node:
87+
ros__parameters:
88+
use_sim_time: true
89+
planner_types: [simple]
90+
simple:
91+
freq: 0.5
92+
plugin: easynav_simple_planner/SimplePlanner
93+
robot_radius: 0.25
94+
95+
sensors_node:
96+
ros__parameters:
97+
use_sim_time: true
98+
forget_time: 0.5
99+
sensors: [laser1]
100+
perception_default_frame: odom
101+
laser1:
102+
topic: scan_raw
103+
type: sensor_msgs/msg/LaserScan
104+
group: points
105+
106+
system_node:
107+
ros__parameters:
108+
use_sim_time: true
109+
position_tolerance: 0.3
110+
angle_tolerance: 0.15
111+
112+
113+
In one terminal, launch the simulator.
114+
You can disable the GUI to save resources if needed:
115+
116+
.. code-block:: bash
117+
118+
ros2 launch easynav_playground_kobuki playground_kobuki.launch.py gui:=false
119+
120+
In a second terminal, launch ``rviz``:
121+
122+
.. code-block:: bash
123+
124+
ros2 run rviz2 rviz2 --ros-args -p use_sim_time:=true
125+
126+
Finally, in a third terminal, start **EasyNav** and specify the parameter file.
127+
(Optionally, you can also create a launcher for convenience):
128+
129+
.. code-block:: bash
130+
131+
ros2 run easynav_system system_main \
132+
--ros-args --params-file /home/fmrico/ros/ros2/easynav_ws/src/easynav_indoor_testcase/robots_params/simple.serest_params.yaml
133+
134+
At this point, you can use the **“2D Goal Pose”** button in ``rviz`` to send target positions for the robot to navigate to.

0 commit comments

Comments
 (0)