VINS-Mono视觉SLAM总体设计框架解读

写在前面

VINS-Mono: A Robust and Versatile Monocular Visual-Inertial State Estimator 的设计思路主要突出两点:

  1. 针对于单目的鲁棒性很强的VIO 系统
  2. 通用性很强的VIO框架

从论文和工程的设计思路无不体现着这两点,从考虑周密的初始化过程,到球面相机模型的引入等等都有体现,至于中间的Keyframe、Sliding Windows 以及4-DoF Pose Graph Optimization都是为了既保证优化的性能,也兼顾系统的实时性所做的一些考量。

论文解读

在这里插入图片描述

vins-mono 概述

解读vins-mono

  • 首先 Measurement Preprocessing (Vision Processing Front End + IMU Preintegration Processing)开始 ;

  • 然后通过一个松耦合的方式来做初始化;

  • 再通过一个紧耦合的方式来做 Local Visual-inertial Odometry;

1. Measurement Preprocessing 过程

  • Visual Preprocessing 每一帧图像特征点提取和 KLT稀疏光流追踪
  • IMU Preprocessing 两帧图像之间IMU预积分
  • Keyframe Selection

2. Estimator Initialization 过程

  • 首先是 Monocular Vision-Only SfM in Sliding Window 得到一个初步的平移和旋转
  • Camera - IMU rotation calibration
  • Visual-inertial alignment 对齐

3. Tightly Computed Monocular VIO

Nonlinear graph optimization-based, tightly-coupled, sliding windows, visual-inertial bundle adjustment

代码解读

各文件夹功能解读

code功能
ar_demo视觉定位的一个小应用demo
benchmark_publisher订阅估计的estimated_odometry, 然后与CVS中的groundtruth对比
calibration_images订阅相机的话题,保存成图片,用于相机校准,支持鱼眼相机,针孔相机
camera_model各种相机模型的校准,入口函数
config配置参数文件
feature_tracker使用光流法追踪特征点
pose_graph后端优化
vins_estimator状态估计

从CMakeLists.txt分析

CMake filesfunction
vins_estimator/CmakeLists.txt生成 vins_estimator Node
feature_tracker/CmakeLists.txt生成 feature_tracker Node
pose_graph/CmakeLists.txt生成 pose_graph Node
camera_model/CmakeLists.txt生成Calibration可执行程序 和camera_model库

vins_estimator

  • 入口函数为 estimator_node.cpp/main()

  • readParameters(n); 读取优化参数,IMU噪声和偏置,IMU-camera内参等

  • estimator.setParameter(); tic ric

  • 订阅 imu_callback feature_callback restart_callback relocalization_callback

  • 发布 Odometry path point-cloud

  • 订阅话题的回调函数只是数据缓存到 buf

  • 真正的处理在线程 std::thread measurement_process{process};中

    getMeasurements 通过时间戳,简单地对齐 IMU 和 feature point
    对于每一个IMU数据: estimator.processIMU(dt, Vector3d(dx, dy, dz), Vector3d(rx, ry, rz));
    对于每一帧CAM数据: estimator.processImage(image, img_msg->header);
    publish Odometry/KeyPoses/CameraPose/PointCloud/TF/Keyframe

vins-estimator 主要程序,
pose_garph
feature_tracker 使用光流法追踪特征点
intrinsic_calib.cc 从其他的库复制过来的

从多线程角度分析

功能类的问题

附录:

参数/变量 名称

参数名称类型来源功能
IMAGE_TOPICstringyaml config file/image_topic订阅图像话题名称
IMU_TOPICstringyaml config file/imu_topic订阅IMU话题名称
MAX_CNTintyaml config file/max_cntmax feature number in feature tracking
MIN_DISTintyaml config file/min_distmin distance between two features
ROWintyaml config file/image_height像素行数-图像高度
COLintyaml config file/image_width像素列数-图像宽度
FREQintyaml config file/freqfrequence (Hz) of publish tracking result. At least 10Hz for good estimation. If set 0, the frequence will be same as raw image
F_THRESHOLDdoubleyaml config file/F_thresholdransac threshold (pixel)
SHOW_TRACKintyaml config file/show_track是否发布 tracking image话题
EQUALIZEintyaml config file/equalize当图像太亮/暗,是否打开均衡补偿
FISHEYEintyaml config file/fisheye是否使用鱼眼相机
FISHEYE_MASKstringyaml config file/fisheye=1fisheye_mask.jpg路径
CAM_NAMESstd::vector<std::string>parameter.cpp全局变量像素列数-图像宽度
WINDOW_SIZEintparameter.cpp全局变量 20滑动窗口的大小
STEREO_TRACKintparameter.cpp全局变量 false是否使用双目追踪
FOCAL_LENGTHintparameter.cpp全局变量 460焦距
PUB_THIS_FRAMEintparameter.cpp全局变量 false不发布这帧
NUM_OF_CAMintparameter.h 1camera的数量
modelTypeCamera::ModelTypeyaml config file/model_type kannala_brandt/mei/scaramuzza/pinholecamera的模型
SOLVER_TIMEdoublemax_solver_time确保实时性,最大求解时间 0.04ms
NUM_ITERATIONSintmax_num_iterations确保实时性,最大迭代次数 8,避免冗余计算
MIN_PARALLAXdoublekeyframe_parallax关键帧选择的视差阈值 10 pixel
VINS_RESULT_PATHintoutput_path/vins_result_no_loop.csv不加回环的输出结果
ESTIMATE_EXTRINSICintestimate_extrinsicIMU和cam相对外参的方式选择,0-有准确可信的参数;1-有一组初始值,后面将基于此再优化,2-完全不知道相对外参,启动之初进行在线校准(注意开始的时候要有旋转) 保存在 output_path/extrinsic_parameter.csv中
RIC[0] cv_R eigen_REigen::Matrix3dextrinsicRotationIMU与camera的旋转
TIC[0] cv_T eigen_TEigen::Vector3dextrinsicRotationIMU与camera的平移
INIT_DEPTHdoublevins_estimator/parameters.hcamera的数量
BIAS_ACC_THRESHOLDdoublevins_estimator/parameters.h 1acc偏置的阈值
BIAS_GYR_THRESHOLDdoublevins_estimator/parameters.h 1陀螺仪偏置的阈值
TDintconfig/tdIMU与camera的固有时钟差
ESTIMATE_TDintconfig/estimate_td置位online estimate time offset between camera and imu
ROLLING_SHUTTERintrolling_shutter: 00-全局快门;1-卷帘快门

NUM_OF_CAM | int | parameter.h 1 | camera的数量

class 名称

FeatureTracker 特征点追踪类
  • FeatureTracker trackerData[NUM_OF_CAM];
CameraFactory 不同的相机类型和校准模型
  • static boost::shared_ptr instance(void);
TicToc 计算时间差的功能类
Estimator

参考文档:

  • 0
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一銤阳光

希望分享的内容对你有帮助

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值