ROS自学实践(8):ROS进行激光SLAM建图——cartographer

本节主要记录运行谷歌cartographer方法,为后续理解这些代码,建立自己的SLAM算法打下基础。

  • 图优化方法
  • 2D/3D地图
  • 精度高

1.安装依赖项

sudo apt-get install -y google-mock libboost-all-dev  libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev  libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx  ros-kinetic-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev

2.安装ceres-solver包

(1)安装所需依赖

sudo apt-get install libgoogle-glog-dev libeigen3-dev libatlas-base-dev libsuitesparse-dev libmetis-dev

(2)下载ceres-solver包,解压
注意可能和eigen3.3不兼容,推荐eigen3.2

mkdir build
cd build
cmake ..
sudo make install

3.安装cartographer

git clone https://github.com/hitcm/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install

5.安装cartographer_ros

mkdir -p carto_ws/src
cd ~/carto_ws/src
catkin_init_workspace
 git clone https://github.com/hitcm/cartographer_ros.git
 cd ..
 catkin_make

5.下载测试

在下面网址下载安装包

https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag

运行测试例程

roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:={$HOME}/carto/cartographer_paper_deutsches_museum.bag

如果出现下面类似情况,说明安装成功
ROS自学实践(8):ROS进行激光SLAM建图——cartographer_第1张图片
未完待续。。。

你可能感兴趣的:(ROS实践,自动驾驶)