walking机器人入门教程-gmapping算法建图

系列文章目录


说明:

  • 介绍如何进行gmapping算法建图

相关设备

步骤:

  • 启动底盘
ros2 launch walking_bringup robot.launch.py 
  • 启动gmapping
ros2 launch walking_slam gmapping.launch.py 
  • 效果图:

  • 启动键盘控制,移动小车继续建图
ros2 launch walking_teleop keyboard.launch.py  
  • 效果图:

  • 新开终端,保存地图:
ros2 run nav2_map_server map_saver_cli -f ~/map/gmapping --ros-args -p save_map_timeout:=10000.00
或
ros2 launch walking_slam save_map.launch.py  map:=${HOME}/map/gmapping
  • 执行效果
$ ros2 launch walking_slam save_map.launch.py  map:=${HOME}/map/gmapping
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2022-01-19-17-06-54-171664-WALKING-97663
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [map_saver_cli-1]: process started with pid [97665]
[map_saver_cli-1] [INFO] [1642583214.601260398] [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] [1642583214.601445499] [map_saver]: Creating
[map_saver_cli-1] [INFO] [1642583214.602590778] [map_saver]: Saving map from 'map' topic to '/home/ubuntu/map/gmapping' file
[map_saver_cli-1] [WARN] [1642583214.602645143] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
[map_saver_cli-1] [WARN] [1642583214.602670448] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
[map_saver_cli-1] [WARN] [map_io]: Image format unspecified. Setting it to: pgm
[map_saver_cli-1] [INFO] [map_io]: Received a 384 X 384 map @ 0.05 m/pix
[map_saver_cli-1] [INFO] [map_io]: Writing map occupancy data to /home/ubuntu/map/gmapping.pgm
[map_saver_cli-1] [INFO] [map_io]: Writing map metadata to /home/ubuntu/map/gmapping.yaml
[map_saver_cli-1] [INFO] [map_io]: Map saved
[map_saver_cli-1] [INFO] [1642583214.755152615] [map_saver]: Map saved successfully
[map_saver_cli-1] [INFO] [1642583214.755299597] [map_saver]: Destroying
[INFO] [map_saver_cli-1]: process has finished cleanly [pid 97665]
  • 保存在用户根目录的map目录下/home/ubuntu/map/,名称为map。实际保存文件为gmapping.pgm和gmapping.yaml
  • 新开终端,打开保存的地图:
eog ~/map/gmapping.pgm
  • 效果图:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值