Ubuntu20.04 安装 cartographer
刚装完,赶紧记录下来!——2025.1.22
官方网页:
Compiling Cartographer ROS — Cartographer ROS documentation
Building & Installation
In order to build Cartographer ROS, we recommend using wstool and rosdep. For faster builds, we also recommend using Ninja.
1.On Ubuntu Focal with ROS Noetic use these commands to install the above tools:
sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow
成功界面:
2.After the tools are installed, create a new cartographer_ros workspace in ‘catkin_ws’.
mkdir catkin_ws
cd catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
我的 ‘catkin_ws’ 就叫做 ‘robot’,请你去到自己的工作空间。
成功界面:
3.Now you need to install cartographer_ros’ dependencies.
First, we use rosdep
to install the required packages. The command ‘sudo rosdep init’ will print an error if you have already executed it since installing ROS. This error can be ignored.
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
成功界面:
报错:
解决:
找到 “cartographer” 包中的 “package.xml” 文件,删除或注释掉 “<depend>libabsl-dev</depend>”
参考:
cartographer: [libabsl-dev] defined as “not available“ for OS version解决方案_cartographer: [libabsl-dev] defined as "not availa-CSDN博客
4.Cartographer uses the abseil-cpp library that needs to be manually installed using this script:
src/cartographer/scripts/install_abseil.sh
成功界面:
5.Due to conflicting versions you might need to uninstall the ROS abseil-cpp using
sudo apt-get remove ros-${ROS_DISTRO}-abseil-cpp
界面:
我估计是我没有。。。
6.Build and install.
catkin_make_isolated --install --use-ninja
成功界面:
我的最后一条是这个,装了大概10分钟才装完,抓紧跑个demo试试!