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 slover,版本1.11
git clone https://github.com/hitcm/ceres-solver-1.11.0.git
cd ceres-solver-1.11.0
mkdir build
cd build
cmake ..
make -j4 //编译的时候会和eigen3.3发生冲突,需要重新安装eigen3.2
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
4.安装Cartographer_ros
#初始化工作空间
mkdir -p ~/cartogra_ros/src
cd ~/cartogra_ros/src
catkin_init_workspace
echo "source cartogra_ros/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
#安装cartographer_ros
cd ~/cartogra_ros/src
git clone https://github.com/hitcm/cartographer_ros.git
cd ~/cartogra_ros
catkin_make
5.数据测试
数据源:
运行launch文件即可
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/cartographer_3d_deutsches_museum.bag
原文地址:https://www.cnblogs.com/penuel/p/11332879.html