如何使用Google 的Cartographer SLAM算法包

文/冷冬寒梅

下面即為具體步驟

(一)安裝cartographer_ros

1)首先安裝wstool和rosdep工具

sudo apt-get update

sudo apt-getinstall -y python-wstool python-rosdep ninja-build

2)然后建立一個(gè)新的workspace

mkdir slam_ws

cd slam_ws

wstool init src

3)安裝cartographer_ros.rosinstall文件,更新

wstool merge -t srchttps://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall

wstool update -t src

4)安裝deb依賴(lài)Installdeb dependencies.

rosdep update

rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

5)安裝和設(shè)置路徑

catkin_make_isolated --install –use-ninja

(此處需要時(shí)間比較長(zhǎng),要耐心等待,我在運(yùn)行時(shí)候,以為此處進(jìn)行不下去了,結(jié)果等的時(shí)間長(zhǎng)些,運(yùn)行成功)

source install_isolated/setup.bash 此語(yǔ)句設(shè)置路徑

(二)根據(jù)需要修改lua配置文件

launch文件如下

參數(shù)如下,不使用odom,只使用激光,參數(shù)如下

每次修改了lua代碼都需要運(yùn)行下面代碼進(jìn)行編譯和設(shè)置路徑

cd slam_ws

catkin_make_isolated --install --use-ninja進(jìn)行編譯

source install_isolated/setup.bash設(shè)置路徑

運(yùn)行l(wèi)aunch文件

roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/dmchen/slam_ws/src/cartographer_ros/cartographer_ros/bag/1014.bag

其中我們自己的數(shù)據(jù)包包1014.bag存儲(chǔ)路徑為/home/dmchen/slam_ws/src/cartographer_ros/cartographer_ros/bag

運(yùn)行結(jié)果

使用激光和odom數(shù)據(jù),參數(shù)設(shè)置如下


注意需要運(yùn)行catkin_make_isolated--install –use-ninja編譯

運(yùn)行效果如下:

備注:關(guān)于lua設(shè)置文件中每個(gè)參數(shù)的意義,以后會(huì)單獨(dú)寫(xiě)文章進(jìn)行說(shuō)明

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容