什么地方可以做网站,河北住房和城乡建设局网站首页,做一个外贸网站,seo品牌优化百度资源网站推广关键词排名一、概述 因为要配置激光SLAM#xff0c;Cartographer属于激光雷达SLAM 中比较经典的一款#xff0c;在学习之前先将其在Ubuntu20.04首先配置出来并成功运行demo。
二、具体操作
#xff08;一#xff09;概述 使用平台是Windows的wsl2上的Ubuntu20.04子系统#xff0c;…一、概述 因为要配置激光SLAMCartographer属于激光雷达SLAM 中比较经典的一款在学习之前先将其在Ubuntu20.04首先配置出来并成功运行demo。
二、具体操作
一概述 使用平台是Windows的wsl2上的Ubuntu20.04子系统双系统与虚拟机的安装原理与这个相同。主要依照的安装操作是官方文档链接如下所示。
Running Cartographer ROS on a demo bag — Cartographer ROS documentationhttps://google-cartographer-ros.readthedocs.io/en/latest/demos.html 按照官方流程大概能安装下来中间可能有些报错这里将逐一分析我在安装过程中遇到的报错。
二操作流程 1.安装依赖 因为我的ros版本是noetic所以根据官方的流程我要进行这样的安装。如下所示、
sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow 如果是之前的版本的话可以使用下面的命令安装依赖。
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build stow 2.下载包 按照官方文档操作将cartographer下载下来。官方文档中caktin_ws可以更换为其他的包名。例如我将其更换为了CartographerSLAM
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 3. 配置依赖 1运行 此步骤也是安装官方文档的操作进行即可其命令以此如下面所示。需要将
${ROS_DISTRO}更改为noetic版本。
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistronoetic -y 需要注意的是在官方文档中的更新命令如图所示。 意思是假如之前使用rosdep init的话这次使用会出现错误但这个错误对之后没有什么影响可以忽略掉。 2报错 这里会出现关于libabsl-dev的问题如下所示 报错的原因是因为无法安装这个依赖。 在github上进行查询后发现了这样的解决方法链接如下所示。
Error while installing dependencies: libabsl-dev not available · Issue #1726 · cartographer-project/cartographer_ros · GitHubI tried installing cartographer ros on a newly set up ubuntu system (20.04.4 LTS with ros noetic installed) and followed the following steps of the documentation: sudo apt-get update sudo apt-get install -y python3-wstool python3-rosdep ...https://github.com/cartographer-project/cartographer_ros/issues/1726 大致的解决思路是将这个包在package.xml文件中的位置给注释掉。如下所示注意是图中红色划出来的包。 在下面将其注释掉如图所示。 之后这个依赖库会手动进行安装的在这里不用担心。 4.编译 1运行命令
src/cartographer/scripts/install_abseil.sh 再运行下面的命令将可能的版本冲突避免掉如下所示由于我的版本是noetic版本官网上面的ros版本号我替换为noetic版本。
sudo apt-get remove ros-noetic-abseil-cpp 在依赖安装完成后进行编译输入如下的命令。命令来源于官方。
catkin_make_isolated --install --use-ninja 2报错 如图所示直接运行会出现下面的报错。 这个地方出现报错的原因是多个ceres库之间的版本出现了问题。导致出现多个版本的原因是因为之前在我的系统上面我安装过ceres库。将之前那个库删除即可。再运行一遍上面安装依赖的命令。再次编译即可编译通过。 参考链接如下。https://github.com/cartographer-project/cartographer/issues/1901https://github.com/cartographer-project/cartographer/issues/1901 5.跑示例包 官方网站参考如下。
Running Cartographer ROS on a demo bag — Cartographer ROS documentationhttps://google-cartographer-ros.readthedocs.io/en/latest/demos.html