< >
Home » walking机器人入门教程#galactic#视频版 » walking机器人入门教程-slam_toolbox算法建图

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

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

说明:

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

相关设备

步骤:

  • 启动底盘
ros2 launch walking_bringup robot.launch.py 
  • 启动slam_toolbox (针对雷达S1的启动方法)
#先启动雷达S1
ros2 launch walking_bringup laser.launch.py 
#再另开终端启动建图      
ros2 launch walking_slam slam_toolbox.launch.py use_laser:=false
  • 启动slam_toolbox (其他雷达的启动建图方法)
#同时启动激光和建图
ros2 launch walking_slam slam_toolbox.launch.py 
  • 效果图:

请输入图片描述

  • 启动键盘控制, 移动小车继续建图
ros2 launch walking_teleop keyboard.launch.py 
  • 完成的效果图:
    请输入图片描述
  • 新开终端,保存地图:
ros2 run nav2_map_server map_saver_cli -f ~/map/slam_toolbox --ros-args -p save_map_timeout:=10000.00
或
ros2 launch walking_slam save_map.launch.py  map:=${HOME}/map/slam_toolbox
  • 执行结果
$ ros2 run nav2_map_server map_saver_cli -f ~/map/slam_toolbox --ros-args -p save_map_timeout:=10000.00
[INFO] [1642582072.186431680] [map_saver]: 
    map_saver lifecycle node launched. 
    Waiting on external lifecycle transitions to activate
    See https://design.ros2.org/articles/node_lifecycle.html for more information.
[INFO] [1642582072.186630327] [map_saver]: Creating
[INFO] [1642582072.188029547] [map_saver]: Saving map from 'map' topic to '/home/ubuntu/map/slam_toolbox' file
[WARN] [1642582072.188089118] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
[WARN] [1642582072.188121324] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
[WARN] [map_io]: Image format unspecified. Setting it to: pgm
[INFO] [map_io]: Received a 364 X 247 map @ 0.05 m/pix
[INFO] [map_io]: Writing map occupancy data to /home/ubuntu/map/slam_toolbox.pgm
[INFO] [map_io]: Writing map metadata to /home/ubuntu/map/slam_toolbox.yaml
[INFO] [map_io]: Map saved
[INFO] [1642582072.300089593] [map_saver]: Map saved successfully
[INFO] [1642582072.300264152] [map_saver]: Destroying
  • 保存在用户根目录的map目录下/home/ubuntu/map/,名称为map。实际保存文件为slam_toolbox.pgm和slam_toolbox.yaml
  • 新开终端,打开保存的地图:
eog ~/map/slam_toolbox.pgm
  • 效果图:
    请输入图片描述

演示视频

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: walking机器人入门教程