• ORBSLAM2实现(kinect V1/ROS)


      实验室电脑环境ubuntu14.04和ROS indigo已经装好。

    1. 构建工作空间【非常重要的一步】

    mkdir -p ~/catkin_ws/src
    cd ~/catkin_ws/
    catkin_make
    source devel/setup.bash
    echo "source devel/setup.bash" >> ~/.bashrc
    source ~/.bashrc

      将source ~/catkin_ws/devel/setup.bash加入到~/.bashrc中去

    2. 安装Pangolin,用于可视化和用户接口

    git clone https://github.com/stevenlovegrove/Pangolin.git
    cd Pangolin
    mkdir build
    cd build
    cmake -DCPP11_NO_BOOST=1 ..
    make -j

    3. 安装BLAS和LAPACK

    sudo apt-get install libblas-dev
    sudo apt-get install liblapack-dev

    4. 构建ORB_SLAM2库

    git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
    cd ORB_SLAM2
    chmod +x build.sh
    ./build.sh

    5. 在~/.bashrc添加路径

    export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/lzp/catkin_mono_orb/src/ORB_SLAM2/Examples/ROS

    6. 在ORB_SLAM2文件夹编译

    mkdir build
    cd build
    cmake .. -DROS_BUILD_TYPE=Release
    make -j

    7. 实现

    roscore
    roslaunch freenect_launch freenect
    -registered-xyzrgb.launch
    rosrun ORB_SLAM2 RGBD
    /home/lzp/catkin_mono_orb/src/ORB_SLAM2/Vocabulary/ORBvoc.txt /home/lzp/catkin_mono_orb/src/ORB_SLAM2/Examples/RGB-D/TUM1.yaml

      注:Kinect驱动的安装

    sudo apt-get install ros-indigo-openni-* ros-indigo-openni2-* \
    
    ros-indigo-freenect-*
    
    rospack profile

    普通单目摄像头实现ORBSLAM2

    1. 使用usb_cam作为单目相机驱动

      从https://github.com/bosch-ros-pkg/usb_cam下载usb_cam,放到工作空间catkin_ws/src下,catkin_make编译

    cd /home/lzp/catkin_mono_orb/src/usb_cam
    
    cd launch
    
    gedit usb_cam-test.launch

    将以下launch文件内容复制到launch文件中:

    <launch>
      <node name="camera" pkg="usb_cam" type="usb_cam_node" output="screen" >
        <param name="video_device" value="/dev/video0" />
        <param name="image_width" value="640" />
        <param name="image_height" value="480" />
        <param name="pixel_format" value="yuyv" />
        <param name="camera_frame_id" value="camera" />
        <param name="io_method" value="mmap"/>
        <remap from="/usb_cam/image_raw" to="/camera/image_raw" />
      </node>
      <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
        <remap from="image" to="/camera/image_raw"/>
        <param name="autosize" value="true" />
      </node>
    </launch>
    <remap from="/usb_cam/image_raw" to="/camera/image_raw" />
    <remap from="image" to="/camera/image_raw"/>
    对两句进行了修改

    2. 中间过程与RGBD过程相同

    3. 实现

    roscore
    
    roslaunch usb_cam usb_cam-test.launch
    
    rosrun ORB_SLAM2 Mono /home/lzp/catkin_mono_orb/src/ORB_SLAM2/Vocabulary/ORBvoc.txt /home/lzp/catkin_mono_orb/src/ORB_SLAM2/Examples/Monocular/TUM1.yaml

      OK

    参考:

    1. http://webdiis.unizar.es/~raulmur/orbslam/

    2 https://github.com/raulmur/ORB_SLAM2

    版权声明:本文为博主原创文章,未经博主允许不得转载。
  • 相关阅读:
    grep命令详解
    Git命令详解(一)-个人使用
    android intent和intent action大全
    android 监控EditText的变化
    第86章、系统服务之TELEPHONY_SERVICE(从零开始学Android)
    android中getSystemService详解
    关于android各种双卡手机获取imei,imsi的处置(mtk,展讯,高通等)
    Android 获取运营商信息(完整版)-解决高通,MTK等双卡问题
    Android 移动缩放的ImageView
    Android 读写SD卡的文件
  • 原文地址:https://www.cnblogs.com/dtyy/p/5531551.html
Copyright © 2020-2023  润新知