< >
Home » Ailibot实体机器人入门教程 » Ailibot入门教程-建图-cartographer 自定位

Ailibot入门教程-建图-cartographer 自定位

Ailibot入门教程-建图-cartographer 自定位

说明

  • 介绍如何在Ailibot上进行cartographer pure localization 自定位

相关设备:

操作步骤

  • [Remote PC] 运行roscore
$ roscore
  • [Ailibot] 启动小车
$ roslaunch ailibot_bringup bringup.launch
  • [Remote PC] 运行cartographer建图程序
$ roslaunch ailibot_slam cartographer.launch
  • [Remote PC] 启动Rviz
$ roslaunch ailibot_rviz view_slam_cartographer.launch --screen
  • [Remote PC] 启动键盘控制
$ roslaunch ailibot_teleop keyboard.launch
  • 移动小车进行建图

  • [Remote PC] 保存为pbstream格式的地图

$ rosservice call /finish_trajectory 0
//若根目录下没有map文件夹,则需要重新创建map文件夹
$ mkdir ~/map && cd ~/map 
$ rosservice call /write_state "{filename: '${HOME}/map/cartographer-localization.pbstream'}"
  • cartographer-localization.pbstream 在 ~/map 目录下里创建

  • 保存完地图后中止以上命令,再重启roscore和启动小车

  • [Remote PC] 运行cartographer_localization程序

$ roslaunch ailibot_slam cartographer_localization.launch load_state_filename:=${HOME}/map/cartographer-localization.pbstream
  • [Remote PC] 启动Rviz
$ roslaunch ailibot_rviz view_slam_cartographer.launch --screen
  • [Remote PC] 启动键盘控制
$ roslaunch ailibot_teleop keyboard.launch
  • 可以尝试将小车搬离到其他地方,再移动一下小车,可以发现小车的位置已匹配到地图上的相应位置

演示视频

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

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


标签: ailibot入门教程