ubuntu18.04中ROS版本为melodic环境安装cartographer
1.安装环境
本文是在ubuntu18.04下重新安装了melodic,然后成功安装并运行了cartographer
2.依赖安装
按照cartographer的官网提供的依赖安装1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19# Install the required libraries that are available as debs.
sudo apt-get update
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 \
stow1
2
3
4
5
6
7
8
9
10
11
12# Install Ceres Solver and Protocol Buffers support if available.
# No need to build it ourselves.
if [[ "$(lsb_release -sc)" = "focal" || "$(lsb_release -sc)" = "buster" ]]
then
sudo apt-get install -y python3-sphinx libgmock-dev libceres-dev protobuf-compiler
else
sudo apt-get install -y python-sphinx
if [[ "$(lsb_release -sc)" = "bionic" ]]
then
sudo apt-get install -y libceres-dev
fi
fi
3.安装abseil-cpp
1 |
|
4.安装ceres-solver
在ceres-solver官网下载1.13.0版本
解压ceres-solver,然后执行以下命令1
2
3
4
5
6
7cd ceres-solver
mkdir build
cd build
cmake .. -G Ninja -DCXX11=ON
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install
这里之所以和官网安装方式不一样是因为,作者在执行git clone https://ceres-solver.googlesource.com/ceres-solver 这个安装命令时一直不成功,可能是网络原因
5.安装protobuf
1 |
|
6.安装cartographer
1 |
|
7.测试demo
下载官方数据1
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
8.运行
1 |
|