ubuntu16.04 + ros-kinetic 配置cartographer

其實一直以來都感覺純視覺SLAM很難落地產品,所以一直在找機會學習激光slam,之前也在深藍學院上買了一個激光salm的課程,慚愧,至今也沒開始學呢,年底之前,我想工作之余研究一下激光slam和ros,我感覺這兩個東西對我來說很重要,所以這兩天先抽時間把google的cartographer工程配置了一下,期間也遇到了一些問題,不過我逐一解決,最終配置成功。接下來就開始研究激光slam技術,以及cartographer的代碼。希望能幫上和我一起想開始學習cartographer的小伙伴,如果有什么問題,可以隨時想我提問,大家一起學習。

更新:注意:我之前安裝了conda,conda里面的python版本是3.7的,我在安裝cartographer_ros的時候沒有關閉conda所以出現了錯誤,因為ros只能在python2.7版本下才能正常工作,所以我就conda deactivate base.這樣就恢復到了原來的python2.7的版本。

參考文獻如下

https://google-cartographer.readthedocs.io/en/latest/

https://blog.csdn.net/xmy306538517/article/details/81455625

https://www.cnblogs.com/hitcm/p/5939507.html

step1:安裝一些依賴庫?

# Install the required libraries that are available as debs.
sudo apt-get update
sudo apt-get install -y \clang \cmake \g++ \git \google-mock \libboost-all-dev \libcairo2-dev \libcurl4-openssl-dev \libeigen3-dev \libgflags-dev \libgoogle-glog-dev \liblua5.2-dev \libsuitesparse-dev \lsb-release \ninja-build \stow# Install Ceres Solver and Protocol Buffers support if available.
# No need to build it ourselves.
if [[ "$(lsb_release -sc)" = "focal" || "$(lsb_release -sc)" = "buster" ]]
thensudo apt-get install -y python3-sphinx libgmock-dev libceres-dev protobuf-compiler
elsesudo apt-get install -y python-sphinxif [[ "$(lsb_release -sc)" = "bionic" ]]thensudo apt-get install -y libceres-devfi
fi

?

step2: 安裝abseil, 注意,在最后一步執行sudo stow absl之前要先執行sudo apt-get install stow安裝stow

git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
git checkout d902eb869bcfacc1bad14933ed9af4bed006d481
mkdir build
cd build
cmake -G Ninja \-DCMAKE_BUILD_TYPE=Release \-DCMAKE_POSITION_INDEPENDENT_CODE=ON \-DCMAKE_INSTALL_PREFIX=/usr/local/stow/absl \..
ninja
sudo ninja install
cd /usr/local/stow
sudo stow absl

step3: 這個下載鏈接是google的資源,如果你沒有設置全局翻墻,在terminal不可翻墻,就不能下載成功,解決方法是在github里搜索ceres-solver,然后采用git clone的方式下載,如果在網頁上直接Download下載下來的工程中滅有.git文件,無法完成git checkout tags/${VERSION}

VERSION="1.13.0"# Build and install Ceres.
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout tags/${VERSION}
mkdir build
cd build
cmake .. -G Ninja -DCXX11=ON
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install

step4: 安裝protobuf.使用下面的下載鏈接下載時如果一直出現early EOF的超時錯誤時,就使用

git clone --depth=1 https://github.com/google/protobuf.git 進行下載,--depth=1是約束了只下載最新git log的版本。

VERSION="v3.4.1"# Build and install proto3.
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout tags/${VERSION}
mkdir build
cd build
cmake -G Ninja \-DCMAKE_POSITION_INDEPENDENT_CODE=ON \-DCMAKE_BUILD_TYPE=Release \-Dprotobuf_BUILD_TESTS=OFF \../cmake
ninja
sudo ninja install

step5: 安裝cartographer

# Build and install Cartographer.git clone git@github.com:cartographer-project/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install

step6:安裝cartographer_ros

注意:創建ros工程的workspace時,根據你自己的路徑來就可以,還有在將工程的devel中的setup.bash的路徑寫入到.bashrc中時也要注意你的路徑。這樣做的好處你,你新打開一個窗口進行操作時,不需要重新執行source YOUR_PATH/devel/setup.bash了就。

sudo apt-get install -y python-wstool python-rosdep ninja-buildmkdir -p /code/ROS/catkin_ws_cartographer/src
cd /code/ROS/catkin_ws_cartographer/src
git clone --recursive https://github.com/googlecartographer/cartographer_ros.gitcd /code/ROS/catkin_ws_cartographer
catkin_make_isolated --install --use-ninja -Dcartographer_DIR="/usr/local/share/cartographer/"
source /code/ROS/catkin_ws_cartographer/devel_isolated/setup.bash
echo "source /code/ROS/catkin_ws_cartographer/devel_isolated/setup.bash" >> ~/.bashrc

step7:下載數據集

2d數據集:

https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag

3d數據集:

https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/b3-2016-04-05-14-14-00.bag

step8: 運行程序

注意:修改成你自己的存放數據集的路徑。

roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/cartographer_3d_deutsches_museum.bag

step9: 測試結果展示

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/252362.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/252362.shtml
英文地址,請注明出處:http://en.pswp.cn/news/252362.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

virtualbox中安裝ubuntu

為什么80%的碼農都做不了架構師?>>> virtualboxubuntu 安裝virtualbox,當前版本是6.0.4下載ubuntu安裝盤,建議lubuntu,鏈接是http://mirrors.ustc.edu.cn/ubuntu-cdimage/lubuntu/releases/18.04.2/release/lubuntu-1…

面向對象重寫(override)與重載(overload)區別

一、重寫(override) override是重寫(覆蓋)了一個方法,以實現不同的功能。一般是用于子類在繼承父類時,重寫(重新實現)父類中的方法。 重寫(覆蓋)的規則&#…

cartographer學習筆記--如何保存cartagrapher_ros建好的地圖

今天開始跟著網友大佬學習cartographer. 1. 如何保存cartographer的地圖數據 在運行cartographer過程中可以隨時保存建好的地圖,步驟如下: 首先是重新打開一個terminal, 如果你沒有將你的cartographer_ros下的setup.bash文件寫入到.bashrc中&#xff…

Java微信公眾號開發(五)—— SVN版本控制工具

1 作用 兩個疑問: 什么是版本控制?為什么要用版本控制工具?作用: 受保護受約束合作開發中,版本控制工具更重要的作用就是讓開發者更好地協作,每個人的代碼既能互相調用,來共同完成一個較大的功…

Linux之《荒島余生》(二)CPU篇

為什么80%的碼農都做不了架構師?>>> 溫馨提示,動圖已壓縮,流量黨放心查看。CPU方面內容不多,我們順便學點命令。本篇是《荒島余生》系列第二篇,垂直觀測CPU。其余參見: Linux之《荒島余生》&am…

PTA 06-圖2 Saving James Bond - Easy Version (25分)

題目地址 https://pta.patest.cn/pta/test/16/exam/4/question/672 5-10 Saving James Bond - Easy Version (25分) This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the worlds most famous spy, was captured by…

Ubuntu16.04上安裝kitti2bag

kitti2bag是一個可以將kitti數據集轉換為bag文件的工具,可以直接通過pip進行安裝。由于kitti2bag中使用到ros,所以安裝時你使用的python版本應該是2.7的因為ros只有在Python2.7時才能正常工作。比如說我,我安裝了conda,在conda中安…

Nginx之windows下搭建

去nginx.org下載nginx 以nginx-1.8.1為例解壓到D盤nginx-1.8.1目錄 假設NGINX_HOME為D:\nginx-1.8.1 3種啟動途徑: 一、雙擊nginx.exe圖標,可見黑窗口一閃而過,啟動完畢。 二、命令行到nginx目錄,輸入nginx啟動。(注&a…

單片機錯誤筆記

記錄下使用單片機過程中的一些錯誤,便于以后查詢: 單片機型號:STC15F2K60S2 晶振:18.432 報錯代碼: *** WARNING L1: UNRESOLVED EXTERNAL SYMBOLSYMBOL: REC_DAT1MODULE: .\Objects\usart.obj (USART) …

軟件開發記錄03

今天我完成了軟件設置&#xff0c;預算列表&#xff0c;添加預算的頁面布局。 &#xff08;1&#xff09;軟件設置 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas.android.com/apk/res/android"…

395. Longest Substring with At Least K Repeating Characters

題目要求 Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.Example 1:Input: s "aaabb", k 3Output: 3The longest substring is "aaa&qu…

UICollectionView 具體解說學習

UICollectionView 和UITableView非常像,是APPLE公司在iOS 6后推出的用于處理圖片這類UITableView 布局困難的控件,和UITableView 一樣,它也有自己的Datasource和delegate。以下具體說下像這種方式的效果. 首先來看看UICollectionView 的DataSource。protocol UICollectionView…

70.文件異常

ferror檢測文件異常perror提示文件錯誤信息clearerr清除異常,讓文件指針回到開頭完整代碼 1 #define _CRT_SECURE_NO_WARNINGS2 #include<stdio.h>3 #include<stdlib.h>4 //perror提示文件錯誤信息5 //ferror檢測文件異常6 //clearerr清除異常,讓文件指針回到開頭…

ServiceNow 中關于UI Action 在portal端的使用

在 portal端是可以使用Form和UI Action的&#xff0c;例如&#xff1a;var data.f $sp.getForm()&#xff1b;//需要添加上相應參數在開箱組件Form的Server script中就有如下代碼&#xff1a;data.f $sp.getForm(data.table, data.sys_id, data.query, data.view);data.f對象中…

特殊密碼鎖

總時間限制: 1000ms內存限制: 1024kB描述有一種特殊的二進制密碼鎖&#xff0c;由n個相連的按鈕組成&#xff08;n<30&#xff09;&#xff0c;按鈕有凹/凸兩種狀態&#xff0c;用手按按鈕會改變其狀態。 然而讓人頭疼的是&#xff0c;當你按一個按鈕時&#xff0c;跟它相鄰…

系統安全題目(二)

1、在 php mysql apache 架構的web服務中輸入GET參數 index.php?a1&a2&a3 服務器端腳本 index.php 中$GET[a] 的值是&#xff1f;正確答案: C A 1B 2C 3D 1,2,3 2、以下哪些不是CSRF漏洞的防御方案&#xff1f;正確答案: D A 檢測HTTPrefererB 使用隨機tokenC 使用驗…

轉發和重定向的區別?

實際發生位置不同&#xff0c;地址欄不同 轉發是發生在服務器的 轉發是由服務器進行跳轉的&#xff0c;細心的朋友會發現&#xff0c;在轉發的時候&#xff0c;瀏覽器的地址欄是沒有發生變化的&#xff0c;在我訪問Servlet111的時候&#xff0c;即使跳轉到了Servlet222的頁面&a…

BZOJ3795 : 魏總刷DP

對于HARD&#xff1a; 需要滿足$ku[i]\times k\leq Tlate[i]$。 對于EASY&#xff1a; 需要滿足$ku[i]\times k\leq T-rest[i]$。 故對于HARD&#xff0c;設$a[i]-late[i]$&#xff0c;對于EASY&#xff0c;設$a[i]rest[i]$&#xff0c;并將所有題目的$u[i]$都$1$。 那么需要滿…

信息學競賽相關優秀文章合集[持續更新]

線段樹詳解 &#xff08;原理&#xff0c;實現與應用&#xff09;可持久化線段樹 簡介 運用伸展樹解決數列維護問題.pdfSplay 學習筆記&#xff08;一&#xff09;Splay 學習筆記&#xff08;二&#xff09;Splay 學習筆記&#xff08;三&#xff09; 請要相信我&#xff0c;30…

ceres-solver學習筆記

前一段時間總有一個想法&#xff0c;那就是&#xff0c;我只直到視覺slam是遠遠不夠的&#xff0c;激光slam仍然是一個比較穩妥的技術&#xff0c;好落地&#xff0c;應用廣泛&#xff0c;我想著&#xff0c;如果我學會了會大大增加自己的核心競爭力&#xff0c;所以我抽時間開…