从工程的角度来看,Google开源的SLAM真是上乘之作,以下为cartographer安装步骤,详细,且让新手少进坑,步骤经过优化,节省大量时间。
ROS版本为melodic 系统为Ubuntu18.04 工作空间名称为carto_ws
//安装工具
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
//初始化工作空间
mkdir carto_ws && cd carto_ws
wstool init src
//加入cartographer_ros.rosinstall并更新依赖
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
输入完第一个命令后需要改文件的下载地址,另起终端输入:
gedit carto_ws/src/.rosinstall
将最后一个git来源网址由https://ceres-solver.googlesource.com/ceres-solver.git改为https://github.com/ceres-solver/ceres-solver.git,,如该果可以挂VPN可以不改。
wstool update -t src
.rosinstall如图所示
为了配合gazebo仿真使用,需要修改protobuf版本为3.0.0
工程目录下修改 gedit src/cartographer/scripts/install_proto3.sh
安装依赖并下载cartographer相关功能包
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=melodic -y
//编译并安装
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
2D包 .
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
//效果图
官方链接
https://google-cartographer-ros.readthedocs.io/en/latest/index.html
————————————————
版权声明:本文严重参考了CSDN博主「strive_kai」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_26482237/article/details/92676267