Ubuntu18.04 安装cartographer

1.安装所有依赖项

sudo apt-get install -y google-mock libboost-all-dev  libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev  libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx  ros-medolic-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev

2. 安装ceres solver
安装ceres-solver-1.13.0版本,其中ceres-solver-1.11.0和ceres-solver-1.14.0编译时会发生错误。
直接从http://ceres-solver.org/ceres-solver-1.13.0.tar.gz上下载ceres-solver-1.13.0,将其置于相应的工作空间的src文件夹(其他位置也可以)下,并进行下面的操作:

tar xvf ceres-solver-1.13.0.tar.gz
cd ceres-solver-1.13.0
mkdir build
cd build
cmake ..
make
sudo make install

3. 安装 cartographer
将其置于相应的工作空间的src文件夹(其他位置也可以)下,安装cartographer功能包过程如下:

git clone https://github.com/cartographer-project/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. 
make
sudo make install

如果执行cmake … 指令发生如下错误时:

-- Found GMock: gmock_main;-lpthread
CMake Error at CMakeLists.txt:32 (find_package):
By not providing "Findabsl.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "absl", but
CMake did not find one.

Could not find a package configuration file provided by "absl" with any of
the following names:

abslConfig.cmake
absl-config.cmake

Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
"absl_DIR" to a directory containing one of the above files. If "absl"
provides a separate development package or SDK, be sure it has been
installed.

解决方案如下:在下载回来的cartographer上有安装absl的脚本

sudo apt-get install stow
sudo chmod +x ~/你的工作空间名/src/cartographer/scripts/install_abseil.sh
cd ~/你的工作空间名/src/cartographer/scripts
 ./install_abseil.sh

其中,执行 ./install_abseil.sh指令时,可能会发生如下错误:

fatal: unable to access 'http://github.com/abseil/abseil-cpp.git': Failed to connect to

将install_abseil.sh文件的20行对应进行修改为:

git clone git://github.com/abseil/abseil-cpp.git

4.安装cartographer_ros

#初始化工作空间
mkdir -p ~/你的工作空间名/src
cd ~/你的工作空间名/src
catkin_init_workspace
echo "source 你的工作空间名/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

#安装cartographer_ros
cd ~/你的工作空间名/src
git clone https://github.com/cartographer-project/cartographer_ros.git
cd ~/你的工作空间名
catkin_make_isolated

执行catkin_make_isolated编译时,出现下面的错误:

/usr/local/include/cartographer/common/lua.h:20:10: fatal error: lua.hpp: 没有那个文件或目录#include <lua.hpp>

解决方案如下:在/usr目录下搜索lua.hpp文件

 find . -name lua.hpp
./include/lua5.2/lua.hpp

将lua.h中<lua.hpp>改成<lua5.2/lua.hpp> 即可解决。

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值