287 字
1 分钟
ROS 环境 Cartographer 安装 测试
本篇主要用作个人学习记录,大部分内容转载自各优秀博主。
ros noetic 安装 cartographer
1.1 安装依赖项
首先,我们需要安装一些依赖项。在终端中输入以下命令:
sudo apt-get updatesudo apt-get install -y python-wstool python-rosdep ninja-build1.2 安装 Cartographer ROS
接下来,创建一个新的工作空间并获取 Cartographer ROS 代码:
mkdir -p ~/catkin_ws/srccd ~/catkin_ws/srcgit clone https://github.com/cartographer-project/cartographer_ros.git这部分也可以这样:
mkdir catkin_wscd catkin_wswstool init srcwstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall1.3 安装所有必要的依赖项
使用 rosdep 安装所有必要的依赖项:
cd ~/catkin_wsrosdep updaterosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y我使用的是noetic版本也就是ubuntu20.04,在这里这条指令会有问题,替换为下条指令
rosdep install -i --from-path src --ignore-src -r1.4 构建 Cartographer ROS
cd ~/catkin_wscatkin_make_isolated --install --use-ninja我在这里出现问题: 问题 ① absl库报错
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.解决方法:
sudo apt-get install stow去catkin_ws/src/cartographer/scripts路径下
sudo chmod +x install_abseil.sh./install_abseil.sh1.5 更新环境变量
source install_isolated/setup.bashcartographer建图测试
下载示例包(例如Deutsches Museum(德意志博物馆)的2D和3D背包系列)到~/Downloads(这里下载到哪时无所谓的),并使用roslaunch来调出演示:
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag这个我下载不下来,会有问题,我最后从网上随便找了一个bag尝试的
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag结果展示:

分享
如果这篇文章对你有帮助,欢迎分享给更多人!
ROS 环境 Cartographer 安装 测试
https://ericonline.cn/posts/cartographer安装测试/ 部分信息可能已经过时
相关文章 智能推荐