ORBSLAM3 在Kinect v2运行

1、Kinect V2的驱动安装及ORBSLAM3安装见本人前面的博客

2、运行

参考ORBslam2 的运行修改命令方法

https://blog.csdn.net/rainvictor1/article/details/72854137

ORBSLAM3 在Kinect v2运行_第1张图片

(1)运行Kinect2b_bridge后使用rosatopic list查看话题

(2)修改rgbd demo中的订阅话题

ORBSLAM3 在Kinect v2运行_第2张图片

3、修改完成后编译ROS节点

在ORB_SLAM3路径下

chmod +x build_ros.sh
./build_ros.sh 

4、对Kinect V2相近进行标定获取相机内参及畸变系数

获取内参和畸变系数后,在 ORB_SLAM2/Examples/RGB-D 下新建 kinect2.yaml,参照 Examples/RGB-D/TUM1.yaml,修改对应参数。

5、也可参照ORBSLAM2的参数配置进行修改

只修改相机参数部分,

Camera calibration and distortion parameters,

# Close/Far threshold. Baseline times.

%YAML:1.0

#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
#Camera.type: "PinHole"
#Camera.type: "KannalaBrandt8"
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV) 
Camera.fx: 529.97
Camera.fy: 526.97
Camera.cx: 477.44
Camera.cy: 261.87

Camera.k1: 0.05627
Camera.k2: -0.0742
Camera.p1: 0.00142
Camera.p2: -0.00169
Camera.k3: 0.0241

Camera.width: 960
Camera.height: 540

# Camera frames per second 
Camera.fps: 30.0

# IR projector baseline times fx (aprox.)
Camera.bf: 40.0

# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 1

# Close/Far threshold. Baseline times.
ThDepth: 50.0

# Deptmap values factor
DepthMapFactor: 1000.0

5、将修改后的YAML配置文件,放置于 /home/catkin_ws/src/ORB_SLAM3/Examples/ROS/ORB_SLAM3路径下

6、运行ORBSLAM3

首先要启动Kinect使起开始发布话题

(1)启动rosemaster

roscore

(2)启动Kinect 

rosrun kinect2_bridge kinect2_bridge

(3)启动ORBSLAM3,直接新开一终端,在根目录输入 

rosrun ORB_SLAM3 RGBD PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE

修改 PATH_TO_VOCABULARY为词袋路径,修改PATH_TO_SETTINGS_FILE为新建的kinect2.yaml路径,执行命令。

运行结果如下:

ORBSLAM3 在Kinect v2运行_第3张图片

你可能感兴趣的:(S视觉LAM,slam)