Test ORB-SLAM2 With Xtion
Device
Device name: Asus Xtion
Install the drive and test
sudo apt-get install ros-melodic-rgbd-launch ros-melodic-openni2-camera ros-melodic-openni2-launch
roslaunch openni2_launch openni2.launch
rqt_image_view
rosrun rviz rviz
Calibration
Calibrate
sudo apt install ros-melodic-camera-calibration
rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.0245 image:=/camera/rgb/image_raw camera:=/camera/rgb
Result
**** Calibrating ****
D = [0.030682647632304865, -0.0823826989859307, 0.002739146610577889, -0.003304125229697052, 0.0]
K = [530.8898489724854, 0.0, 304.1163611053325, 0.0, 529.4348885994814, 237.55801617038634, 0.0, 0.0, 1.0]
R = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
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]
None
# oST version 5.0 parameters
[image]
width
640
height
480
[narrow_stereo]
camera matrix
530.889849 0.000000 304.116361
0.000000 529.434889 237.558016
0.000000 0.000000 1.000000
distortion
0.030683 -0.082383 0.002739 -0.003304 0.000000
rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
projection
530.652344 0.000000 301.765707 0.000000
0.000000 531.557312 238.541613 0.000000
0.000000 0.000000 1.000000 0.000000
Test ORB-SLAM
Without ROS
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml /home/zavier/robot/Slam/dataset/rgbd_dataset_freiburg1_xyz
./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
sudo gedit ~/.bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/zavier/robot/Slam/ORB_SLAM2/Examples/ROS
chmod +x build_ros.sh
./build_ros.sh
Issue
https://blog.csdn.net/He3he3he/article/details/109231891
https://blog.csdn.net/weixin_44401286/article/details/102566260
sudo ln -s /usr/lib/python2.7/dist-packages/rospkg /opt/ros/melodic/lib/python2.7/dist-packages/rospkg
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 !!!!
roslaunch openni2_launch openni2.launch
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
- orb-slam2 can’t save full trajectory for monocular method, only can save key frame trajectory, why???
- how to evaluate the difference between two trajectories?