Skip to content

Commit a316a60

Browse files
Add mapping support (#11)
* Added teleop support to ease mapping. Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com> * Use online async mapping with SLAM Toolbox. Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com> * Update the documentation to reflect the mapping process. Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com> --------- Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
1 parent 431ea2a commit a316a60

File tree

6 files changed

+492
-54
lines changed

6 files changed

+492
-54
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Tutorial
6363
* Open a new terminal and run the teleoperation node:
6464

6565
```bash
66-
ros2 run key_teleop_ros key_teleop_ros
66+
ros2 run key_teleop_ros key_drive
6767
```
6868

6969
Use the arrow keys to control the robot's movement.
@@ -74,6 +74,40 @@ Tutorial
7474

7575
https://github.com/user-attachments/assets/cd9df2df-2087-4dc8-8ce1-d5b526d30321
7676

77+
### 3. Mapping
78+
79+
* Launch the robot in Gazebo:
80+
81+
```bash
82+
ros2 launch atreus gazebo.launch.py
83+
```
84+
85+
* Open another terminal and run the mapping node:
86+
87+
```bash
88+
ros2 launch atreus slam_toolbox.launch.py
89+
```
90+
91+
This will start the mapping process using **SLAM Toolbox**.
92+
93+
* Open a new terminal and run the teleoperation node:
94+
95+
```bash
96+
ros2 run key_teleop_ros key_drive
97+
```
98+
99+
This will allow you to map the environment by driving the robot around.
100+
101+
https://github.com/user-attachments/assets/b92657ef-2855-4d6b-8c25-e220f16a3816
102+
103+
104+
* In order to save the map, open a new terminal and run the following command:
105+
106+
```bash
107+
ros2 run nav2_map_server map_saver_cli -f my_map
108+
```
109+
110+
This will save the map to the current directory.
77111

78112

79113
###### 💾 EOF
Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,75 @@
11
slam_toolbox:
22
ros__parameters:
33

4+
# Plugin params
5+
solver_plugin: solver_plugins::CeresSolver
6+
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
7+
ceres_preconditioner: SCHUR_JACOBI
8+
ceres_trust_strategy: LEVENBERG_MARQUARDT
9+
ceres_dogleg_type: TRADITIONAL_DOGLEG
10+
ceres_loss_function: None
11+
12+
# ROS Parameters
413
odom_frame: odom
514
map_frame: map
615
base_frame: base_link
7-
scan_topic: /scan
16+
scan_topic: scan
17+
use_map_saver: true
18+
mode: localization
19+
20+
# if you'd like to immediately start continuing a map at a given pose
21+
# or at the dock, but they are mutually exclusive, if pose is given
22+
# will use pose
23+
#map_file_name: test_steve
24+
# map_start_pose: [0.0, 0.0, 0.0]
25+
#map_start_at_dock: true
26+
27+
debug_logging: false
28+
throttle_scans: 1
29+
transform_publish_period: 0.02 #if 0 never publishes odometry
30+
map_update_interval: 5.0
31+
resolution: 0.05
32+
min_laser_range: 0.1 #for rastering images
33+
max_laser_range: 16.0 #for rastering images
34+
minimum_time_interval: 0.5
35+
transform_timeout: 0.2
36+
tf_buffer_duration: 30.0
37+
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps
38+
enable_interactive_mode: true
39+
40+
# General Parameters
41+
use_scan_matching: true
42+
use_scan_barycenter: true
43+
minimum_travel_distance: 0.5
44+
minimum_travel_heading: 0.5
45+
scan_buffer_size: 10
46+
scan_buffer_maximum_scan_distance: 10.0
47+
link_match_minimum_response_fine: 0.1
48+
link_scan_maximum_distance: 1.5
49+
loop_search_maximum_distance: 3.0
50+
do_loop_closing: true
51+
loop_match_minimum_chain_size: 10
52+
loop_match_maximum_variance_coarse: 3.0
53+
loop_match_minimum_response_coarse: 0.35
54+
loop_match_minimum_response_fine: 0.45
55+
56+
# Correlation Parameters - Correlation Parameters
57+
correlation_search_space_dimension: 0.5
58+
correlation_search_space_resolution: 0.01
59+
correlation_search_space_smear_deviation: 0.1
60+
61+
# Correlation Parameters - Loop Closure Parameters
62+
loop_search_space_dimension: 8.0
63+
loop_search_space_resolution: 0.05
64+
loop_search_space_smear_deviation: 0.03
65+
66+
# Scan Matcher Parameters
67+
distance_variance_penalty: 0.5
68+
angle_variance_penalty: 1.0
869

9-
max_laser_range: 16.
70+
fine_search_angle_offset: 0.00349
71+
coarse_search_angle_offset: 0.349
72+
coarse_angle_resolution: 0.0349
73+
minimum_angle_penalty: 0.9
74+
minimum_distance_penalty: 0.5
75+
use_response_expansion: true

0 commit comments

Comments
 (0)