Turtlebot3中级教程-gmapping算法建图
说明
- 介绍如何在turtlebot3上通过gmapping算法进行建图
操作步骤
- [Remote PC] 启动roscore
$ roscore
- [TurtleBot] 启动turtlebot3
$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
- [Remote PC] 运行gmapping和启动rviz
$ export TURTLEBOT3_MODEL=${TB3_MODEL}
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
如果想单独打开Rviz,可以注释掉
turtlebot3_slam.launch
中的rviz部份,再单独运行下面的命令[Remote PC] 启动rviz
$ rviz -d `rospack find turtlebot3_slam`/rviz/turtlebot3_gmapping.rviz
- [Remote PC] 启动键盘控制
$ export TURTLEBOT3_MODEL=${TB3_MODEL}
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
移动机器人进行建图
[Remote PC] 保存地图
$ rosrun map_server map_saver -f ~/map
- 效果图:
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号