一鍵安裝ROS,需要在屬性里面給fishros.sh文件設(shè)置運(yùn)行權(quán)限
成都創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比思茅網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式思茅網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋思茅地區(qū)。費(fèi)用合理售后完善,10年實(shí)體公司更值得信賴。安裝依賴wget http://fishros.com/install -O fishros sudo ./fishros
Pangolinsudo apt install libgl1-mesa-dev sudo apt install libglew-dev sudo apt install libpython2.7-dev sudo apt install pkg-config sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
下載地址:https://github.com/stevenlovegrove/Pangolin.git
最好安裝0.5版本的:Release v0.5 · stevenlovegrove/Pangolin (github.com)
Eigen3.2.1cd Pangolin mkdir build cd build cmake .. cmake --build . sudo make install
下載地址:Releases · libeigen / eigen · GitLab
OpenCv3.2.0mkdir build cd build cmake .. sudo make install sudo ln -s /usr/local/include/eigen3 /usr/include/eigen3
下載地址:https://github.com/opencv/opencv/releases/tag/3.2.0
Boostmkdir build cd build cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. -DENABLE_PRECOMPILED_HEADERS=OFF //編譯中遇到問(wèn)題,把ippicv_linux_20151201.tgz替換到opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e文件下 之后再cmake一下 sudo make sudo make install //配置環(huán)境 sudo gedit /etc/ld.so.conf.d/opencv.conf 文末添加 /usr/local/lib sudo ldconfig sudo gedit /etc/bash.bashrc 文末添加 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH 配置生效 source /etc/bash.bashrc sudo updatedb
下載地址:https://www.boost.org/users/download/
ORB_SLAM3tar -xvf boost_1_77_0.tar.gz cd ./boost_1_77_0 ./bootstrap.sh sudo ./b2 install
下載地址:UZ-SLAMLab/ORB_SLAM3: ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM (github.com)
安裝依賴確保這些都安裝上
遇到問(wèn)題 1.orb_slam3運(yùn)行視圖sudo apt install libboost-filesystem-dev sudo apt-get install libssl-dev sudo apt install libboost-all-dev
把ORB_SLAM3/Examples/Monocular中的mono_euroc.cc中第83行的函數(shù)第四個(gè)參數(shù)中的false改為true
2.版本號(hào)更改ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::MONOCULAR, true);
把ORB_SLAM3文件夾下的CMakeLists.txt中opencv和eigen的版本換一下,Thirdparty/g2o中也有一個(gè)CMakeLists一同修改
3.隱去未使用定義變量的警告把CMakeLists.txt中-Wall后面加一個(gè)-w,添加c++14的編譯選擇
4.內(nèi)存不足set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -w -O3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -w -O3") add_compile_options(-std=c++14) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -march=native") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")
報(bào)錯(cuò):c++: internal compiler ereor: killed(program cciplus)
添加一個(gè)交換空間,我之前加的4G的好像還是運(yùn)行錯(cuò)誤,直接加了8G
5.修改ros—slam3可能報(bào)錯(cuò)的地方sudo swapoff -a sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 sudo mkswap /swapfile sudo swapon /swapfile 最后啟動(dòng)的時(shí)候可能會(huì)遇到錯(cuò)誤:swapon: /swapfile: insecure permissions 0644, 0600 suggested. sudo chmod -R 600 swapfile //關(guān)閉刪除交換空間 sudo swapoff /swapfile sudo rm /swapfile
在編譯ROS——ORB_SLAM3時(shí),需要改一些代碼
找到ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR下的ros_mono_ar.cc文件:
把
cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());
改為
cv::Mat Tcw; Sophus::SE3f Tcw_SE3f = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec()); Eigen::Matrix4f Tcw_Matrix = Tcw_SE3f.matrix(); cv::eigen2cv(Tcw_Matrix, Tcw);
找到ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR下的ViewerAR.cc文件
把
vPoints.push_back(pMP->GetWorldPos());
改為
cv::Mat WorldPos; cv::eigen2cv(pMP->GetWorldPos(), WorldPos); vPoints.push_back(WorldPos);
把
cv::Mat Xw = pMP->GetWorldPos();
改為
編譯ORB_SLAM3cv::Mat Xw; cv::eigen2cv(pMP->GetWorldPos(), Xw);
運(yùn)行樣例 數(shù)據(jù)集cd Thirdparty/DBoW2 mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j cd ../../g2o mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j cd ../../Sophus mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j cd ../../../ cd Vocabulary tar -xf ORBvoc.txt.tar.gz cd .. mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j4
下載:https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
下載Machine Hall 01數(shù)據(jù)
下載完解壓到MH01文件夾,注意MH01文件夾下面是mav0
運(yùn)行腳本和修改代碼下載euroc_examples.sh腳本,放到Example文件夾下面
下載地址:ORB_SLAM3/euroc_examples.sh at master · yuantao15/ORB_SLAM3 (github.com)
將pathDatasetEuroc=后面放上MH01的上級(jí)文件夾,注意是相對(duì)路徑
我的MH01的絕對(duì)路徑是/home/orbslam3/workspace/ORB_SLAM3/Examples/Datasets/EuRoC/MH01
所以應(yīng)該加上./Datasets/EuRoC
之后就可以運(yùn)行了。
運(yùn)行截圖ORB_SLAM3-ROS編譯 遇到問(wèn)題 1.修改環(huán)境變量./euroc_examples.sh 或者 ./Monocular/mono_euroc ../Vocabulary/ORBvoc.txt ./Monocular/EuRoC.yaml ./Datasets/EuRoC/MH01 ./Monocular/EuRoC_TimeStamps/MH01.txt dataset-MH01_mono
把
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM3/Examples_old/ROS
//path需要補(bǔ)全為絕對(duì)路徑
加到~/.bashrc最后一行
sudo gedit ~/.bashrc
source ~/.bashrc
2.CMakelist修改到ORB_SLAM3/Examples_old/ROS/ORB_SLAM3下的CMakeLists.txt,找到include_directories并添加 ${PROJECT_SOURCE_DIR}/…/…/…/Thirdparty/Sophus
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/../../../
${PROJECT_SOURCE_DIR}/../../../include
${PROJECT_SOURCE_DIR}/../../../include/CameraModels
${PROJECT_SOURCE_DIR}/../../../Thirdparty/Sophus
${Pangolin_INCLUDE_DIRS}
)
同時(shí)修改eigen和opencv的版本號(hào)
編譯ROScd Examples/ROS/ORB_SLAM3
mkdir build
cd build
cmake .. -DROS_BUILD_TYPE=Release
make -j
運(yùn)行樣例
數(shù)據(jù)集下載:http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
下載ROS bag數(shù)據(jù)集
啟動(dòng) 1.roscoreroscore
2.Stereo節(jié)點(diǎn)啟動(dòng)rosrun ORB_SLAM3 Stereo Vocabulary/ORBvoc.txt Examples_old/Stereo/EuRoC.yaml true
3.啟動(dòng)rosbagrosbag play --pause MH_01_easy.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw /imu0:=/imu
運(yùn)行效果和上面的是一樣的。
實(shí)際運(yùn)行如果運(yùn)行相機(jī)節(jié)點(diǎn)的話,需要修改asus.yaml中的相機(jī)內(nèi)參配置,并且修改對(duì)應(yīng).cc文件中的訂閱節(jié)點(diǎn)。還沒(méi)實(shí)現(xiàn),后面再來(lái)更新。
參考基于ubuntu18.04的ORB_SLAM3安裝 (qq.com)
(22條消息) Ubuntu18.04安裝Ros(最新最詳細(xì)親測(cè))_向日葵騎士Faraday的博客-博客_ubuntu18.04安裝ros
(22條消息) ubuntu18.04配置ORB-SLAM3(包含ROS)完整版教程_黃宏智的博客-博客_orbslam3 ros
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧
當(dāng)前名稱:Ubuntu18.04從0安裝ORB-創(chuàng)新互聯(lián)
文章位置:http://www.rwnh.cn/article30/pcppo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、網(wǎng)站設(shè)計(jì)公司、自適應(yīng)網(wǎng)站、軟件開(kāi)發(fā)、網(wǎng)站建設(shè)、網(wǎng)站策劃
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容