从工程的角度来看,Google开源的SLAM真是上乘之作,以下为cartographer安装步骤,详细,且让新手少进坑,步骤经过优化,节省大量时间。
ROS版本为kinetic 系统为Ubuntu16.04 工作空间名称为carto_ws
//安装工具‘
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
//初始化工作空间
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
工作空间下输入安装proto否则编译会出错 src/cartographer/scripts/install_proto3.sh
安装依赖并下载cartographer相关功能包
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
(我默认版本为kinetic,若是其他ROS版本相应替换)
//编译并安装
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
可以将这个命令放到bashrc文件中,否则每次运行demo都需要输入一遍,否则找不到launch文件
//测试
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
如果下载速度慢,直接去网页下载。
3D 包
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/with_intensities/b3-2016-04-05-14-14-00.bag
roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag
我的命令是
//效果图
官方链接
https://google-cartographer-ros.readthedocs.io/en/latest/index.html