OAK-D-PRO-POE相机跑通ORB_SLAM3双目实例

1.参照官方教程安装depthai_ros;1.1. ROS1 noetic + depthai_ros教程 — DepthAI Docs 0.3.0.0 documentation

2.安装好depthai_ros之后测试下面指令:

roslaunch depthai_examples stereo_node.launch

 此指令代表启动depthai_examples包下的stereo_node.launch节点,如下图所示

3.接下来下载编译OPR_SLAM3,参照安装ORB-SLAM3教程-CSDN博客

4.查看并修改相机参数。

4.1在dai_ws工作区下运行roslaunch depthai_examples stereo_node.launch指令,打开另外一个终端输入rostopic list 指令

输入以下指令可分别查看左右相机内参

rostopic echo -n 1 /stereo_publisher/left/camera_info

 rostopic echo -n 1 /stereo_publisher/right/camera_info

之后即可出现内参信息

4.2参照下图分别得出内参信息:

4.3编写oak-d-pro-poe相机的内参文件 oak-d-pro-poe.yaml

%YAML:1.0

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

# Camera calibration and distortion parameters (OpenCV)
# Copied from the EEPROM data dump in depthai_demo.py.
Camera.fx: 836.39874268   #需要修改
Camera.fy: 836.66235352  #需要修改
Camera.cx: 636.00115967 #需要修改
Camera.cy: 357.10168457 #需要修改

Camera.k1: 0.0
Camera.k2: 0.0
Camera.k3: 0.0
Camera.k4: 0.0
Camera.p1: 0.0
Camera.p2: 0.0

Camera2.fx: 843.39074707 #需要修改
Camera2.fy: 843.87249756 #需要修改
Camera2.cx: 635.90380859 #需要修改
Camera2.cy: 359.52798462 #需要修改

Camera2.k1: 0.0
Camera2.k2: 0.0
Camera2.k3: 0.0
Camera2.k4: 0.0
Camera2.p1: 0.0
Camera2.p2: 0.0

Camera.bFishEye: 0

Camera.width: 1280
Camera.height: 720

# Camera frames per second
Camera.fps: 30.0

# stereo baseline times fx
Camera.bf: 62.729905701  #需要修改

# 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: 37.5

#--------------------------------------------------------------------------------------------
# ORB Parameters
#--------------------------------------------------------------------------------------------

# ORB Extractor: Number of features per image
ORBextractor.nFeatures: 1200

# ORB Extractor: Scale factor between levels in the scale pyramid       
ORBextractor.scaleFactor: 1.2

# ORB Extractor: Number of levels in the scale pyramid  
ORBextractor.nLevels: 8

# ORB Extractor: Fast threshold
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
# You can lower these values if your images have low contrast                   
ORBextractor.iniThFAST: 20
ORBextractor.minThFAST: 7

#--------------------------------------------------------------------------------------------
# Viewer Parameters
#--------------------------------------------------------------------------------------------
Viewer.KeyFrameSize: 0.05
Viewer.KeyFrameLineWidth: 1
Viewer.GraphLineWidth: 0.9
Viewer.PointSize:2
Viewer.CameraSize: 0.08
Viewer.CameraLineWidth: 3
Viewer.ViewpointX: 0
Viewer.ViewpointY: -0.7
Viewer.ViewpointZ: -1.8
Viewer.ViewpointF: 500

根据4.1得到的内参信息对照4.2修改信息。

5.运行ORB SLAM3

5.1在dai_ws工作区中启动双目节点

roslaunch depthai_examples stereo_node.launch

5.2 在orb slam3中打开第二个终端

rosrun ORB_SLAM3 Stereo ORB_SLAM3/Vocabulary/ORBvoc.txt oak-d-pro-poe.yaml false

false 表示是否进行图像校正。在这里,设置为 "false" 表示不进行图像校正处理。

若出现报错

 Usage: rosrun ORB_SLAM3 Stereo path_to_vocabulary path_to_settings do_rectify

则将指令中 ORBvoc.txt和oak-d-pro-poe.yaml的路径改为绝对路径。

效果如下图所示

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值