1、安装ninja编译器
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build stow
2、安装依赖
sudo apt-get install -y \
clang \
cmake \
g++ \
git \
google-mock \
libboost-all-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libsuitesparse-dev \
lsb-release \
ninja-build \
stow
创建一个工作空间, 下载cartographer、cartographer_ros、ceres-solver
mkdir carto_ws
cd carto_ws
wstool init src
可以看到carto_ws/src文件路径下存在一个“.rosinstall”文件。
在“.rosinstall”文件中加入下述内容:
- git:
local-name: cartographer
uri: https://github.com/googlecartographer/cartographer.git
version: 1.0.0
- git:
local-name: cartographer_ros
uri: https://github.com/googlecartographer/cartographer_ros.git
version: 1.0.0
ninja编译
catkin_make_isolated --install --use-ninja
3、出现问题
1)Could not find a package configuration file provided by “absl” with any of
the following names:
abslConfig.cmake
absl-config.cmake
在下载回来的cartographer上有安装absl的脚本
sudo apt-get install stow
sudo chmod +x ~/carto_ws/src/cartographer/scripts/install_abseil.sh
cd ~/carto_ws/src/cartographer/scripts
./install_abseil.sh
2)Could not find a package configuration file provided by “ceres” with any of
the following names:
在下载回来的cartographer上有安装ceres的脚本
可以参考
https://www.guyuehome.com/34165
https://blog.csdn.net/weixin_39458342/article/details/103276265