1.启动仿真世界:
roslaunch turtlebot3_gazebo turtlebot3_world.launch
2.启动gmapping
建图节点
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
3.启动小车键盘控制节点,控制小车移动:
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
分别安wadx键进行请按前进后退左右移动
4. 保存建好的地图
rosrun map_server map_saver -f /home/slam/catkin_ws/map
打开 map.yaml 文件指定地图pgm的地址如下:
image: /home/slam/catkin_ws/map.pgm
二.导航
1. 启动仿真世界:
roslaunch turtlebot3_gazebo turtlebot3_world.launch
2.
启动导航节点进行导航
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=/home/slam/catkin_ws/map.yaml
3. 点击rviz界面的 2D pose Estimate 对小车位置进行初始化,再rviz地图中点击小车实际的位置
然后点击2D Nav Goal随机设定一个位置,小车会导航过去。
小车默认使用的局部路径规划算法是DWA算法,全局路径规划规划算法是A*
标签:仿真,map,turtlebot3,小车,tultlebot3,slam,roslaunch
From: https://www.cnblogs.com/liuweiweitju/p/18021562