ROS2与Turbot3-Multi多机协同教程-单机遥控建图
文章说明
- 本教程主要介绍如何使用Turbot3-Multi套件进行单机建图的操作
- 测试环境:
Ubuntu 24.04
+ROS2 Jazzy
相关设备
- Turbot3-Multi套件:采购地址
操作步骤
- [NUC] 关闭此前打开的ros程序,以免造成冲突
$ ./multi_scripts/single_kill.sh 0
$ ./multi_scripts/server_kill.sh
- [NUC] 启动单机
client0
端
$ ./multi_scripts/single_robot.sh 0
- [NUC] 启动建图,默认使用gmapping算法
$ ./multi_scripts/single_slam.sh 0
- [NUC] 新开终端,查看tf
$ ros2 run rqt_tf_tree rqt_tf_tree
- [NUC] 新开终端,启动键盘控制
$ ./multi_scripts/single_key.sh 0
- [NUC] 新开终端,保存地图
$ ./multi_scripts/single_save_map.sh 0
------------------------------------------------------
./multi_scripts/single_save_map.sh [client_id]
[client_id] Default value: 0
Such as: "./multi_scripts/single_save_map.sh 1"
It will launch the map_saver node for client1 robot.
------------------------------------------------------
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2025-03-12-17-01-52-204173-TB3-NUC-V500-14557
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [map_saver_cli-1]: process started with pid [14560]
[map_saver_cli-1] [INFO] [1741770112.443625982] [tb3_0.map_saver]:
[map_saver_cli-1] map_saver lifecycle node launched.
[map_saver_cli-1] Waiting on external lifecycle transitions to activate
[map_saver_cli-1] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[map_saver_cli-1] [INFO] [1741770112.443691903] [tb3_0.map_saver]: Creating
[map_saver_cli-1] [INFO] [1741770112.443778975] [tb3_0.map_saver]: Configuring
[map_saver_cli-1] [INFO] [1741770112.447019831] [tb3_0.map_saver]: Saving map from 'map' topic to '/home/ubuntu/map/tb3_0' file
[map_saver_cli-1] [WARN] [1741770112.447042483] [tb3_0.map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
[map_saver_cli-1] [WARN] [1741770112.447050154] [tb3_0.map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
[map_saver_cli-1] [WARN] [1741770112.488423951] [map_io]: Image format unspecified. Setting it to: pgm
[map_saver_cli-1] [INFO] [1741770112.488802333] [map_io]: Received a 384 X 608 map @ 0.05 m/pix
[map_saver_cli-1] [INFO] [1741770112.541968693] [map_io]: Writing map occupancy data to /home/ubuntu/map/tb3_0.pgm
[map_saver_cli-1] [INFO] [1741770112.543292469] [map_io]: Writing map metadata to /home/ubuntu/map/tb3_0.yaml
[map_saver_cli-1] [INFO] [1741770112.543375101] [map_io]: Map saved
[map_saver_cli-1] [INFO] [1741770112.543386621] [tb3_0.map_saver]: Map saved successfully
[map_saver_cli-1] [INFO] [1741770112.544789347] [tb3_0.map_saver]: Destroying
[INFO] [map_saver_cli-1]: process has finished cleanly [pid 14560]
save map into /home/ubuntu/map/tb3_0.yaml and /home/ubuntu/map/tb3_0.pgm
- 地图默认保存在
/home/ubuntu/map/
目录下,且命名为tb3_0
演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号