Cartographer在ROS中的编译安装

ubuntu16.04+ROS(Kinetic)+cartographer-1.0.0

cartographer的安装主要包括cartographer、cartographer_ros、ceres-solver三个部分;
ROS(Kinetic)安装教程:https://blog.csdn.net/weixin_42576673/article/details/105118467
cartographer官网:https://google-cartographer.readthedocs.io/en/latest/#
cartographer_ros官网:https://google-cartographer-ros.readthedocs.io/en/latest/
ceres-solver官网:http://ceres-solver.org/

本次采取事先下载好安装包,直接进行编译操作,附文件的云盘链接(免);

免墙文件提取码:6udj

组织架构

Cartographer在ROS中的编译安装_第1张图片
cartographer工程目录

安装依赖

# Install the required libraries that are available as debs
$ sudo apt-get update
$ sudo apt-get install lsb-release -y
$ sudo apt-get install cmake -y
$ 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
# Build and install Ceres-solver(version 1.14.0)
$ cd ceres-solver
$ mkdir build
$ cd build
$ cmake .. -G Ninja -DCXX11=ON
$ ninja
$ CTEST_OUTPUT_ON_FAILURE=1 ninja test # test ceres-solver
$ sudo ninja install
# Build and install proto3(version 3.6.0)
$ cd protobuf
$ 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

编译

$ sudo rosdep init
$ rosdep update
# The command ‘sudo rosdep init’ will print an error if you have already executed it since installing ROS. This error can be ignored.
$ rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
$ catkin_make_isolated --install --use-ninja

测试

$ source install_isolated/setup.bash
$ roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:='/home/slamml/Project/cartographer/bag/cartographer_paper_deutsches_museum.bag' # 2d数据包测试
Cartographer在ROS中的编译安装_第2张图片
demo_2d运行图

你可能感兴趣的:(#,Cartographer)