Gazebo仿真环境使用Cartographer算法建图
1.cartographer环境配置,并运行demo
2.下载turtlebot3,并编译
cd ~/catkin_make/src
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ..
catkin_make
3.设置环境变量
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
source ~/.bashrc
4.修改launch文件
catkin_ws/src/turtlebot3/turtlebot3_slam/launch/turtlebot3_cartographer.launch文件
把$(arg configuration_basename)更改为turtlebot3_lds_2d_gazebo.lua
5.打开Gazebo仿真环境
roslaunch turtlebot3_gazebo turtlebot3_world.launch
6.使用cartographer算法建图
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer
7.使用键盘控制Turtlebot3运动
8.保存地图
rosrun map_server map_saver -f ~/map