Ubuntu18.04下成功实现ORB_SLAM2 奥比中光astra深度相机
?? 在ROS環境下,采用奧比中光的Astra深度相機,復現ORB_SLAM2代碼,真的太難了,不過csdn上有好多大佬,純純地靠大佬們帶飛,基本上我是參照這篇博客使用奧比中光Orbbec Astra Pro在ROS下跑orb_slam2_梁小憨憨的博客-CSDN博客來實現的,博主寫的超級詳細,簡直是搞視覺SLAM小白的福音。所以針對我在實現ORB_SLAM2過程中存在的問題做個簡單整理:
一、在ROS melodic環境下安裝奧比中光相機驅動
1、按照參考的博客開始安裝,到run astra_camera這步時,深度圖可以看到,彩色圖像顯示“NO image”,應該是相機接口的問題,我試了他的解決方法,好像還是有問題,然后就去一頓搜索。
(1)首先查看相機接口:
lsusb可以查閱到:
Bus 001 Device 019: ID 2bc5:0502 # RGB模塊
Bus 001 Device 018: ID 2bc5:0403 # 深度模塊
(2)接著修改Astrapro.launch
cd ~/home/wsy/robot_positioning_ws/src/astra_camera/launch gedit astrapro.launch改為如下所示:(只改RGB模塊)
? <param name="product" value="0x0502"/>
source一下:
source ~/rgbd_ws/devel/setup.bash?再次運行:
roslaunch astra_camera astrapro.launch二、安裝ORB_SLAM2
按照步驟一步步來,直到實時運行ORB_SLAM2在編譯的時候出現問題了:
./build_ros.sh運行完之后會出現一堆錯誤,按照這篇Ubuntu18.04 編譯 ORB-SLAM2(./build.sh + ./build_ros.sh)完整流程,各種報錯處理(踩坑總結)_m0_60355964的博客-CSDN博客_./build_ros.sh
1、解決部分問題,但是有個“'sudo rosdep init' and 'rosdep update'”問題困擾很久:
[rosbuild] Building package ORB_SLAM2
Failed to invoke /opt/ros/noetic/bin/rospack deps-manifests ORB_SLAM2
[rospack] Error: the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
CMake Error at /opt/ros/noetic/share/ros/core/rosbuild/public.cmake:129 (message):
??
? Failed to invoke rospack to get compile flags for package 'ORB_SLAM2'.
? Look above for errors from rospack itself. ?Aborting. ?Please fix the
? broken dependency!
Call Stack (most recent call first):
? /opt/ros/noetic/share/ros/core/rosbuild/public.cmake:207 (rosbuild_invoke_rospack)
? CMakeLists.txt:4 (rosbuild_init)
-- Configuring incomplete, errors occurred!
See also "/home/liuxinze/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. ?Stop.
?按照如下步驟進行終端輸入:
sudo -H pip3 install rosdepc sudo rosdepc init rosdepc update參考:orb_slam2編譯 ./build_ros.sh出現問題 很久沒辦法解決 請大家幫個忙謝謝!-編程語言-CSDN問答
?
2、還遇到了“Pangolin could not be found because dependency Eigen3 could not be found”的問題。
問題報錯如下:
?
CMake Error at CMakeLists.txt:25 (find_package):
? Found package configuration file:
??? /usr/local/lib/cmake/Pangolin/PangolinConfig.cmake
? but it set Pangolin_FOUND to FALSE so package "Pangolin" is considered to
? be NOT FOUND.? Reason given by package:
? Pangolin could not be found because dependency Eigen3 could not be found.
-- Configuring incomplete, errors occurred!
See also "/home/dongying/study/ManhattanSLAM/build/CMakeFiles/CMakeOutput.log".
See also "/home/dongying/study/ManhattanSLAM/build/CMakeFiles/CMakeError.log".
Makefile:940: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
?參照博客:Pangolin could not be found because dependency Eigen3 could not be found._復古藍的博客-CSDN博客
解決方法如下:
在CMakeLists.txt文件下修改,CMakeLists.txt文件路徑為:
/home/wsy/工作空間/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2
?找到find_package(Eigen3 3.1.0 REQUIRED)并進行以下修改:
find_package(Eigen3 REQUIRED NO_MODULE)這樣問題就解決的差不多了,可以正常運行了。
總結
以上是生活随笔為你收集整理的Ubuntu18.04下成功实现ORB_SLAM2 奥比中光astra深度相机的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: WIN7系统安装VisualSVN Se
- 下一篇: Emil发送