视觉学习笔记7——ZED2安装SDK,并用于ORB-SLAM3( 三 )


大概意思就是没有ros imu的包,用命令安装一下:
sudo apt-get install ros-melodic-imu-tools
报错3:源更新问题
安装 ros--imu-tools失败
错误:1 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu bionic/main amd64 ros-melodic-imu-complementary-filter amd64 1.2.3-1bionic.20220127.155013404Not Found [IP: 2402:f000:1:400::2 80]
不知道为什么404,看链接感觉像自带软件源,可是我一直阿里云的源,试试去更新源
sudo apt-get update
更新后又可以安装ros--imu-tools,具体原因未知 。。。
报错4:USB3.0问题
运行调用命令时,表示设置失败
[ INFO] [1664370769.746576278]: ZED connection -> CAMERA FAILED TO SETUP[ INFO] [1664370777.009440351]: ZED connection -> CAMERA FAILED TO SETUP[ INFO] [1664370784.697619171]: ZED connection -> CAMERA FAILED TO SETUP
刚开始百思不得其解,后来想起自己电脑接口不够用,把zed2接在usb扩展器上,但zed相机要求USB3.0的接口进行传输,更换后调用成功 。
四、调用orb slam3+zed2 1、完善配置
目前搭建了环境,结合我之前的工作,默认也搭建好了,如果没有可以参考我写的博客 。

视觉学习笔记7——ZED2安装SDK,并用于ORB-SLAM3

文章插图
因为ORB-SLAM3中并没有提供zed2的配置文件,在ORB-SLAM3的官方上ros的示例文件中没有相关的操作 。执行./.sh也无效,并没有生成ros下的可执行文件,因为作者/下的.txt中并没有ros包可执行文件生成的操作,作者把ros的相关配置都放在了//ROS/文件下了 。
所以需要做好以下工作:
1. 创建相关.yaml和.cc文件
cdORB_SLAM3-master/Examples_old/ROS/ORB_SLAM3/srctouch zed2_stereo_inertial.cctouch zed2_stereo_inertial.yaml
相机在出厂的时候已经经过初步调试了,可以直接用这个.yaml参数
.yaml文件
%YAML:1.0#--------------------------------------------------------------------------------------------# Camera Parameters. Adjust them!#--------------------------------------------------------------------------------------------Camera.type: "PinHole"# Camera calibration and distortion parameters (OpenCV) (equal for both cameras after stereo rectification)Camera.fx: 528.3009033203125Camera.fy: 528.3009033203125Camera.cx: 632.7931518554688Camera.cy: 372.5525817871094# 用的是校正过的节点,所以畸变参数设置为0Camera.k1: 0.0Camera.k2: 0.0Camera.p1: 0.0Camera.p2: 0.0Camera.width: 1280Camera.height: 720# Camera frames per second Camera.fps: 15.0# stereo baseline times fxCamera.bf: 63.396108984375# 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: 40.0 # 35# Transformation from camera 0 to body-frame (imu)# 从左目转换到IMU坐标系Tbc: !!opencv-matrixrows: 4cols: 4dt: fdata: [ 0.0055827285742915,0.0128040922714603,0.9999024394223516,0.0285440762197234,-0.9999801332587812,0.0029981004108222,0.0055447706603969, -0.1038871459045697,-0.0029268121592544, -0.9999135295689473, 0.0128205754767047, -0.0063514683297355,0.0000000000000000, -0.0000000000000000, -0.0000000000000000,1.0000000000000000]# IMU noise# get it from Project of **zed-examples/tutorials/tutorial 7 - sensor data/**.IMU.NoiseGyro: 0.007 # 1.6968e-04 IMU.NoiseAcc:0.0016 # 2.0000e-3IMU.GyroWalk:0.0019474 IMU.AccWalk:0.0002509 # 3.0000e-3IMU.Frequency: 400#--------------------------------------------------------------------------------------------# Stereo Rectification. Only if you need to pre-rectify the images.# Camera.fx, .fy, etc must be the same as in LEFT.P#--------------------------------------------------------------------------------------------LEFT.height: 720LEFT.width: 1280LEFT.D: !!opencv-matrixrows: 1cols: 5dt: ddata: [0, 0, 0, 0, 0]LEFT.K: !!opencv-matrixrows: 3cols: 3dt: ddata: [528.3009033203125, 0.0, 632.7931518554688, 0.0, 528.3009033203125, 372.5525817871094, 0.0, 0.0, 1.0]LEFT.R:!!opencv-matrixrows: 3cols: 3dt: ddata: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]LEFT.Rf:!!opencv-matrixrows: 3cols: 3dt: fdata: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]LEFT.P:!!opencv-matrixrows: 3cols: 4dt: ddata: [528.3009033203125, 0.0, 632.7931518554688, 0.0, 0.0, 528.3009033203125, 372.5525817871094, 0.0, 0.0, 0.0, 1.0, 0.0]RIGHT.height: 720RIGHT.width: 1280RIGHT.D: !!opencv-matrixrows: 1cols: 5dt: ddata: [0, 0, 0, 0, 0]RIGHT.K: !!opencv-matrixrows: 3cols: 3dt: ddata: [528.3009033203125, 0.0, 632.7931518554688, 0.0, 528.3009033203125, 372.5525817871094, 0.0, 0.0, 1.0]RIGHT.R:!!opencv-matrixrows: 3cols: 3dt: ddata: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]RIGHT.P:!!opencv-matrixrows: 3cols: 4dt: ddata: [528.3009033203125, 0.0, 632.7931518554688, -63.47084045410156, 0.0, 528.3009033203125, 372.5525817871094, 0.0, 0.0, 0.0, 1.0, 0.0]#--------------------------------------------------------------------------------------------# ORB Parameters#--------------------------------------------------------------------------------------------# ORB Extractor: Number of features per imageORBextractor.nFeatures: 1200# ORB Extractor: Scale factor between levels in the scale pyramidORBextractor.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 contrastORBextractor.iniThFAST: 20ORBextractor.minThFAST: 7#--------------------------------------------------------------------------------------------# Viewer Parameters#--------------------------------------------------------------------------------------------Viewer.KeyFrameSize: 0.05Viewer.KeyFrameLineWidth: 1Viewer.GraphLineWidth: 0.9Viewer.PointSize:2Viewer.CameraSize: 0.08Viewer.CameraLineWidth: 3Viewer.ViewpointX: 0Viewer.ViewpointY: -0.7Viewer.ViewpointZ: -1.8Viewer.ViewpointF: 500