使用Indemind双目模组跑ORB_SLAM3

文章目录

  • Indemind双目模组跑通ORB_SLAM3
    • 1.下载源码编译
    • 2.ROS编译错误
    • 3.配置文件
  • Indmeind跑ORB_SLAM3的VIO
    • 1.按照ORB_SLAM3正常编译即可
    • 2.运行
  • Indemind双目模组跑ORB_SLAM3实测

Indemind双目模组跑通ORB_SLAM3

首先感谢作者的贡献与开源。ORB_Slam3的介绍不做叙述,这里只对编译过程做出详细介绍。ORB_Slam3的介绍创新有时间在更新。

1.下载源码编译

ORB_SLAM3地址
纯视觉或加IMU跑Euroc数据集效果很好。
纯视觉跑或加IMU跑Indmeind双目模组表现也很好,注意在录制数据集的时候可以参考Euroc数据集初始的摆动,时间大概在20-30秒之间即可完成初始化。(ORB_SLAM3的对初始化的要求比较高)

//按照官方编译即可
//正常ROS编译
catkin_make
//编译ORB_SLAM3
cd ORB_SLAM3
chmod +x build.sh
./build.sh

这里对ROS进行编译会有一些错误。

2.ROS编译错误

1.类似与这种的错误

[rosbuild] rospack found package "ORB_SLAM2" at "", but the current   directory is "/home/angelo/ORB_SLAM2/Examples/ROS/ORB_SLAM2".  You should   double-check your ROS_PACKAGE_PATH to ensure that packages are found in the   correct precedence order.

将所有代码下的命名空间由ORB_SLAM2改为ORB_SLAM3
这样改完之后你还会遇到错误
2.某个.h文件的GeometricCamera.h、KannalaBrandt8.h、Pinhole.h文件找不到

1.在该.h文件添加正确的路径
2.其实这三个.h文件是在报错的.h文件的下一级目录,可以复制到上一级

别高兴,你应该还会遇到一类错误
3.boost文件找不到Makefile,这个主要是你编译了多个ORB_SLAM
解决办法Examples/ROS/ORB_SLAM3/Cmakelist.txt里面添加

target_link_libraries(Stereo boost_system boost_filesystem)  
target_link_libraries(RGBD boost_system boost_filesystem) 
target_link_libraries(Mono boost_system boost_filesystem) 

注意一些topic问题,安装sdk,启动sdk看之前博客,这样你就可以顺利的跑起来SDK
注意实时双目或者单目,有时可以有时会卡死,建议录制成ros包
下面这图是纯双目,跑的自己录制的ros包,效果不错。
使用Indemind双目模组跑ORB_SLAM3_第1张图片使用Indemind双目模组跑ORB_SLAM3_第2张图片

3.配置文件

标定Indmeind读取配置文件看上一篇文章,或者其他标定方法也可,直接对Euroc数据集的配置文件进行更改,即便参数设置为0,下面贴出一份我手里模组的配置文件

%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:  260.561
Camera.fy: 260.561
Camera.cx: 317.946
Camera.cy: 195.495

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

Camera.width: 640
Camera.height: 400

# Camera frames per second 
Camera.fps: 25

# stereo baseline times fx
Camera.bf: 31.26732 #31.26732

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

# Transformation from camera 0 to body-frame (imu)
Tbc: !!opencv-matrix
   rows: 4
   cols: 4
   dt: f
   data: [-0.999977, -0.006624, -0.001162, 0.0060095, 0.006621, -0.999975, 0.002465, 2.61872e-05, -0.001178, 0.002458, 0.999996, -0.002,
         0.0, 0.0, 0.0, 1.0]

# IMU noise
IMU.NoiseGyro: 1.000000000000000e-1  # 1.6968e-04 
IMU.NoiseAcc: 1.000000000000000e-1 # 2.0000e-3
IMU.GyroWalk: 4.000000000000000e-3  
IMU.AccWalk: 4.0000000000000000e-3 # 3.0000e-3
IMU.Frequency: 200

#--------------------------------------------------------------------------------------------
# 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: 400
LEFT.width: 640
LEFT.D: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data:[-0., 0., 0.0, 0, 0.0]
LEFT.K: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [245.96, 0, 318.423, 0, 245.793, 195.635, 0.0, 0.0, 1.0]
LEFT.R:  !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [0.999988, 0.0036888, -0.00331281, -0.00368906, 0.999993, -7.24943e-05, 0.00331252, 8.47145e-05, 0.999995]
LEFT.Rf:  !!opencv-matrix
   rows: 3
   cols: 3
   dt: f
   data: [1, 0,0,0,1, 0, 0,0,1]
LEFT.P:  !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [260.561, 0, 317.946, 0, 0, 260.561, 195.495, 0,  0, 0, 1, 0]

RIGHT.height: 400
RIGHT.width:  640
RIGHT.D: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data:[-0., 0.0, -0.00, 0, 0.0]
RIGHT.K: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [245.861, 0, 312.777, 0, 246.03, 195.784, 0.0, 0.0, 1]
RIGHT.R:  !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [0.999915, -0.00648092, -0.011273, 0.00648181, 0.999979, 4.20702e-05, 0.0112724, -0.000115136, 0.999936]
RIGHT.P:  !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [260.561, 0, 317.946 ,-31.161, 0 ,260.561, 195.495, 0, 0, 0, 1, 0]

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

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

# 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

Indmeind跑ORB_SLAM3的VIO

首先,官方没有提供VIO的ROS接口,依赖于热心网友(大神)的贡献,现在贴出地址xiefei2929 作者也是做出了改进,读取速度更快

1.按照ORB_SLAM3正常编译即可

cd ORB_SLAM3
chmod +x build.sh
./build.sh

chmod +x build_ros.sh
./build_ros.sh

2.运行

首先ORB_SLAM3初始化要求比较高,先完成初始化,初始化完成之后,在进行一些其他的运动。而且实时的SDK会很卡,1秒10M,建议还是录制ros包完成测试。
(1)启动sdk
(2)启动ORB_SLAM3

Mono_inertial: rosrun ORB_SLAM3 Mono_inertial /YOUR_PATH/ORBvoc.bin /YOUR_PATH/EuRoC.yaml
Stereo_inertial: rosrun ORB_SLAM3 Stereo_inertial /YOUR_PATH/ORBvoc.bin /YOUR_PATH/EuRoC.yaml

这里放上几张跑的自己采的数据集的图,三个数据集,效果还是不错的。
使用Indemind双目模组跑ORB_SLAM3_第3张图片
使用Indemind双目模组跑ORB_SLAM3_第4张图片
使用Indemind双目模组跑ORB_SLAM3_第5张图片
使用Indemind双目模组跑ORB_SLAM3_第6张图片
使用Indemind双目模组跑ORB_SLAM3_第7张图片

Indemind双目模组跑ORB_SLAM3实测

实测视频

你可能感兴趣的:(使用Indemind双目模组跑ORB_SLAM3)