1.编译cartographer ROS

1.系统要求

cartographer ROS与Cartographer要求一样,即

  • 64-bit, modern CPU (e.g. 3rd generation i7)
  • 16 GB RAM
  • Ubuntu 14.04 (Trusty) and 16.04 (Xenial)
  • gcc version 4.8.4 and 5.4.0

支持的ROS版本:

  • Indigo
  • Kinetic
  • Lunar
  • Melodic

编译并安装

为了编译Cartographer ROS,推荐使用wstoolrosdep。为了更快得编译,建议使用Ninja

sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build

在catkin_ws中创建一个新的cartographer_ros工作空间。

mkdir catkin_ws
cd catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src

安装cartographer_ros依赖(proto3 和deb包)。如果在安装ROS的时候已经执行了命令sudo rosdep init,那么将会打印错误,如果没有执行则执行该命令,另外该错误忽略。

src/cartographer/scripts/install_proto3.sh
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

编译和安装

catkin_make_isolated --install --use-ninja

version 找 pcl-1.8  https://larrylisky.com/2016/11/03/point-cloud-library-on-ubuntu-16-04-lts/

gflags的手动安装

可能会报错:

Ubuntu之前的是proto2,cartographer要求是proto3

 同时安装了proto2,优先找了/usr/bin/protoc的版本, 新安装的proto3放在/usr/local/bin/protoc下,建立一个软连接。

  • $ sudo mv /usr/bin/protoc /usr/bin/protoc.bk
  • $ sudo ln -s /usr/local/bin/protoc /usr/bin/protoc
原文地址:https://www.cnblogs.com/gary-guo/p/10418884.html