Test ORB-SLAM2 With Xtion

Device

Device name: Asus Xtion

Install the drive and test

  1. sudo apt-get install ros-melodic-rgbd-launch ros-melodic-openni2-camera ros-melodic-openni2-launch
  2. roslaunch openni2_launch openni2.launch
  3. rqt_image_view
  4. rosrun rviz rviz

Calibration

Calibrate

  1. sudo apt install ros-melodic-camera-calibration
  2. rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.0245 image:=/camera/rgb/image_raw camera:=/camera/rgb

Result

  1. **** Calibrating ****
  2. D = [0.030682647632304865, -0.0823826989859307, 0.002739146610577889, -0.003304125229697052, 0.0]
  3. K = [530.8898489724854, 0.0, 304.1163611053325, 0.0, 529.4348885994814, 237.55801617038634, 0.0, 0.0, 1.0]
  4. R = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
  5. P = [530.65234375, 0.0, 301.7657070271671, 0.0, 0.0, 531.5573120117188, 238.5416133291801, 0.0, 0.0, 0.0, 1.0, 0.0]
  6. None
  7. # oST version 5.0 parameters
  8. [image]
  9. width
  10. 640
  11. height
  12. 480
  13. [narrow_stereo]
  14. camera matrix
  15. 530.889849 0.000000 304.116361
  16. 0.000000 529.434889 237.558016
  17. 0.000000 0.000000 1.000000
  18. distortion
  19. 0.030683 -0.082383 0.002739 -0.003304 0.000000
  20. rectification
  21. 1.000000 0.000000 0.000000
  22. 0.000000 1.000000 0.000000
  23. 0.000000 0.000000 1.000000
  24. projection
  25. 530.652344 0.000000 301.765707 0.000000
  26. 0.000000 531.557312 238.541613 0.000000
  27. 0.000000 0.000000 1.000000 0.000000

Test ORB-SLAM

Without ROS

  1. ./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml /home/zavier/robot/Slam/dataset/rgbd_dataset_freiburg1_xyz
  1. ./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml /home/zavier/robot/Slam/dataset/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/MH01.txt

Use ROS

  1. sudo gedit ~/.bashrc
  2. export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/zavier/robot/Slam/ORB_SLAM2/Examples/ROS
  1. chmod +x build_ros.sh
  2. ./build_ros.sh

Issue

https://blog.csdn.net/He3he3he/article/details/109231891

https://blog.csdn.net/weixin_44401286/article/details/102566260

  1. sudo ln -s /usr/lib/python2.7/dist-packages/rospkg /opt/ros/melodic/lib/python2.7/dist-packages/rospkg
  2. sudo ln -s /usr/lib/python2.7/dist-packages/catkin_pkg /opt/ros/melodic/lib/python2.7/dist-packages/catkin_pkg

Test

modify file ros_mono.cc rostopic from /camera/image_raw to /camera/rgb/image_raw, then rebuild !!!!

  1. roslaunch openni2_launch openni2.launch
  2. rosrun ORB_SLAM2 Mono /home/zavier/robot/Slam/ORB_SLAM2/Vocabulary/ORBvoc.txt /home/zavier/robot/Slam/ORB_SLAM2/Examples/ROS/ORB_SLAM2/xtion.yaml

Problem

  1. orb-slam2 can’t save full trajectory for monocular method, only can save key frame trajectory, why???
  2. how to evaluate the difference between two trajectories?