1. 程式人生 > >ROS kinetic下rgbdslam-v2的安裝和使用

ROS kinetic下rgbdslam-v2的安裝和使用

文章目錄

簡介

RGBD-SLAM-v2 is a state-of-the-art SLAM system for RGB-D cameras, e.g., the Microsoft Kinect. You can use it to create highly accurate 3D point clouds or OctoMaps.

RGBDSLAMv2 is based on the ROS project, OpenCV, PCL, OctoMap, SiftGPU and more.

執行環境

  • 平臺
    • Ubuntu 16.04 + ROS kinetic
  • 資料來源
    • RGB-D dataset: rgbd_dataset_freiburg1_xyz.bag
    • RGB-D camera: Realsense Camera ZR300

安裝依賴

  • sudo apt-get install libglew1.5-dev libdevil-dev libsuitesparse-dev
  • rgbdslam作者的g2o
    git clone https://github.com/felixendres/g2o.git
    
  • pcl-1.8.0
    wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0.tar.gz
    
    pcl-1.8.0 的 CMakeLists.txt 中加入 C++11 支援:
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    

依賴庫g2o和pcl不相容,可能導致 “required process[rgbdslam-2] has died”…Iinitiating down 問題,程式掛掉。

編譯 rgbdslam_v2

  • 下載 rgbdslam_v2
    wget -q http://github.com/felixendres/rgbdslam_v2/archive/kinetic.zip
    
  • rosdep
    rosdep update
    rosdep install rgbdslam
    
  • 修改 CMakeLists.txt
    • 第6行加入: add_compile_options(-std=c++11)
    • set(USE_SIFT_GPU 1 CACHE BOOL "build with support for siftgpu") 改為 set(USE_SIFT_GPU 0 CACHE BOOL "build with support for siftgpu")
    • find_package(PCL 1.7 REQUIRED COMPONENTS common io) 改為 find_package(PCL 1.8 REQUIRED COMPONENTS common io)
  • 編譯
    catkin_make
    

執行

RGB-D 資料集

RGB-D 資料集 使用 rgbd_dataset_freiburg1_xyz.bag

  • 修改 rgbdslam_v2 的 launch檔案 rgbdslam.launch 中的 影象topic
    <param name="config/topic_image_mono"              value="/camera/rgb/image_color"/>
    <param name="config/topic_image_depth"             value="/camera/depth/image"/>
    
  • 執行
    roscore & rosbag play rgbd_dataset_freiburg1_xyz.bag
    roslaunch rgbdslam rgbdslam.launch
    
  • 結果
    rgbdslam_v2_rgbd_dataset_freiburg1_xyz.png

RGB-D 相機

RGB-D 相機 使用 Realsense Camera ZR300

  • 修改 rgbdslam_v2 的 launch檔案 rgbdslam.launch 中的 影象topic
    <param name="config/topic_image_mono"              value="/camera/rgb/image_color"/>
    <param name="config/topic_image_depth"             value="/camera/depth_registered/sw_registered/image_rect_raw"/>
    
  • 執行
    roslaunch realsense_camera zr300_nodelet_rgbd.launch
    roslaunch rgbdslam rgbdslam.launch
    
  • 結果
    rgbdslam_v2_realsense_zr300.png

參考