ROS_Kinetic_27 在ROS中使用Cartographer进行SLAM
Cartographer是谷歌新開源的通用的2D和3D定位與構圖同步的SLAM工具,並提供ROS接口。
论文Real-Time Loop Closure in 2D LIDAR SLAM下载地址:
http://download.csdn.net/detail/zhangrelay/9648192
资料汇总请参考:http://blog.csdn.net/zhangrelay/article/details/52748648
视频: 1 http://v.youku.com/v_show/id_XMTc1MzI1MTYyNA
2 http://v.youku.com/v_show/id_XMTc1MzI1MDQwNA
3 http://v.youku.com/v_show/id_XMTc1MzI1MDgyMA
1. 編譯和安裝:
官網提供了基於Ubuntu 14.04(Trusty)和ROS(indigo)測試和安裝說明,這裏在Ubuntu 16.04(Xenial)和ROS(Kinetic)安裝並測試。建議使用wstool和rosdep,並在編譯時使用Ninja。注意這裏是cartographer_ros,
如果只使用cartographer,請参考: https://google-cartographer.readthedocs.io/en/latest/
安裝wstool和rosdep:
~$ sudo apt-get install -y python-wstool python-rosdep ninja-build
新建工作空間,這裏使用catkin_ctg:
~$ mkdir catkin_ctg
~$ cd catkin_ctg
~/catkin_ctg$ wstool init src
從github下載,當然也可以使用:
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
Github下載地址:https://github.com/googlecartographer
~/catkin_ctg$ wstool update -t src
~/catkin_ctg$ rosdep install --from-paths src --ignore-src --rosdistro=${kinetic} -y
#All required rosdeps installedsuccessfully
~/catkin_ctg$ catkin_make_isolated --install --use-ninja
編譯需要10分鍾以上,休息一下。
如果報錯,如下:
確保網絡正常後,重試。也可以手動安裝ceres_solver非線性優化庫, https://github.com/ceres-solver/ceres-solver
編譯完成後不要忘記source:
~/catkin_ctg$ source install_isolated/setup.bash
到這裏,編譯和安裝就基本結束了。
2. 測試demo:
在保證cartographer和cartographer_ros都安裝好,可以下載數據記錄包,啓動demo,
這裏只測試了1(493.4MB)和3(3.2MB),2和4數據記錄包太大了,分別爲8GB和3GB,有興趣可以下載測試。
使用roslaunch會自動啓動roscore和rviz。
~$ roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/cartographer_paper_deutsches_museum.bag
~$ roslaunch cartographer_ros demo_revo_lds.launch bag_filename:=${HOME}/cartographer_paper_revo_lds.bag
附原汁原味的论文:
-End-