本文已参与「新人创作礼」活动,一起开启掘金创作之路
Cartographer是google推出的一套基于图优化的SLAM算法,cartographer采取的是google的ceres构建problem优化,采取的是4线程后端优化。
优点:累计误差低,能天然的输出协方差矩阵,后端优化的输入项。成本较低的雷达也能跑出不错的效果。
缺点:内存占用较大
Cartographer的架构
主要由 Local SLAM和Global SLAM两部分组成
Local SLAM
利用里程计(Odometry)和IMU数据进行轨迹推算,给出小车位姿估计值,将位姿估计值作为初值,对雷达数据进行匹配,并更新位姿估计器的值。雷达一帧帧数据经过运动滤波后,进行叠加,形成子图(submap)。
Global SLAM
回环检测,后端优化,全部子图形成一张完整可用的地图
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
复制代码
9.点击2D Nav Goal,设置目标点,导航。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END