turtlebot3-burger_150.png
turtlebot3-waffle-pi_150.png
turtlebot3-arm_150.png
walking-y2_150.png
turbot3-multi_150.png
turbot3-dl-ros1_150.png
turbot3-ai.png
turbot3-dl-ros2_150.png
turbot3-slam_150.png
turbot3-arm_150.png
turtlebot4-lite_150.png
turtlebot4-pro_150.png
turbot4-dl_150.png
turbot4-ai_150.png
aidriving-racebot_150.png
aidriving-autodrive_150.png
turtlebot-arm_150.png
openmanipulator-x_150.png
Home » Ailibot实体机器人入门教程 » Ailibot入门教程-建图-cartographer 自定位

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

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号

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

  • 可以尝试将小车搬离到其他地方,再移动一下小车,可以发现小车的位置已匹配到地图上的相应位置

演示视频

<iframe height=498 width=100% src="//player.bilibili.com/player.html?aid=65741319&cid=114064951&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号


标签: ailibot入门教程