Ubuntu16.04 环境依赖
sudo apt-get install -y \
clang \
g++ \
git \
google-mock \
libboost-all-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libsuitesparse-dev \
ninja-build \
python-sphinx
安装ceres-solver
mkdir cartographer_ws/src -p
Cd cartographer_ws
git clone https://github.com/ceres-solver/ceres-solver.git
Cd ceres-solver
git checkout tags/1.13.0
mkdir build
cd build
cmake .. -G Ninja -DCXX11=ON
ninjaCTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install
注意:如果用ninja 编译出错,则用标准c++ 编译方法,
cd build
cmake ..
Make
Sudo make install
安装protobuf 3.4.1
cd cartographer_ws
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout tags/v3.4.1
mkdir build
cd build
cmake -G Ninja \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_TESTS=OFF \
../cmake
ninja
sudo ninja install
安装cartographer
cd cartographer_ws
Git clone https://github.com/googlecartographer/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninjaCTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install
注意:如果用ninja 编译出错,则用标准c++ 编译方法
安装cartographer_ros
cd cartographer_ws/src
Git clone https://github.com/googlecartographer/cartographer_ros.git
cd cartographer_ws
catkin_make_isolated
下载bag 数据包,并运行算法验证运行是否正常
//下载ros bag 数据包
wget -P ~/Downloads 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}/Downloads/cartographer_paper_deutsches_museum.bag