cartographer第二次安装踩坑

文章讲述了作者在尝试安装Cartographer时遇到的问题,包括编译错误和缺失的ceres-solver库。通过使用scripts/install.sh,作者发现需要降级至ceres-solver2.0.0版本并手动安装,最终成功编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

之前安装过cartographer,但是意外出了问题,无法编译,删除之后就再也无法成功安装,最后的编译一直会出各种错误,试了好久终于又重新装上

感谢大佬脚本

GitHub - WLwind/cartographer_installation: Shell script for installing cartographer_rosShell script for installing cartographer_ros. Contribute to WLwind/cartographer_installation development by creating an account on GitHub.icon-default.png?t=N7T8https://github.com/WLwind/cartographer_installation里面提供了两个脚本install.shinstall_without_rosdep_init.sh,前者默认可以正常rosdep update,后者默认新装的ros还没有进行过rosdep init。

我是第二次安装,就选择了第一个install.h。内容:

#!/bin/bash -e
set -o errexit
sudo apt update
sudo apt install -y python3-wstool ninja-build stow
mkdir -p ~/cartographer_ws/src
cp .rosinstall ~/cartographer_ws/src/
cd ~/cartographer_ws
wstool update -t src
git clone https://gitee.com/WLwindlinfeng/abseil-cpp.git
cd abseil-cpp
git checkout d902eb869bcfacc1bad14933ed9af4bed006d481
mkdir build
cd build
cmake -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DCMAKE_INSTALL_PREFIX=/usr/local/stow/absl \
  ..
ninja
sudo ninja install
cd /usr/local/stow
sudo stow absl
cd ~/cartographer_ws
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin_make_isolated --install --use-ninja -j3

下载直接运行就行,但是有报错,仔细查看发现.rosinstall中没有ceres-solver库,手动添加也不行。编译还不通过。报错没有相应库函数

偶然发现有个外国老哥说要用ceres-solver2.0.0,默认下载安装的都是2.2.0

手动下载2.0.0,最终成功编译

-

手动安装过程:

https://github.com/ceres-solver/ceres-solver/releases/tag/2.0.0

下载tar.gz压缩包到src下,解压

cd ceres-solver-2.0.0/
mkdir build
cd build/
cmake ..
make
sudo make install

安装完成后再回到cartographer工作空间,运行

catkin_make_isolated --install --use-ninja -j3

即可顺利完成编译

-------------------------------------------------------------分割-------------------------------------------------------

事后再运行节点时要source的文件不是devel_isolated/setup.bash,(虽然其他的一般都是)

这个应source的文件路径

source install_isolated/setup.bash 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值