首页 > 代码库 > VINS(二)Feature Detection and Tracking

VINS(二)Feature Detection and Tracking

系统入口是feature_tracker_node.cpp文件中的main函数

首先创建feature_tracker节点,从配置文件中读取信息(parameters.cpp),包括:

  • ROS中发布订阅的话题名称;
  • 图像尺寸;
  • 优化参数(最大求解时间以保证实时性,不卡顿;对大迭代次数,避免冗余计算;视差阈值,用于选取sliding window中的关键帧);
  • imu参数,包括加速度计陀螺仪的测量噪声标准差、零偏随机游走噪声标准差,重力值(imu放火星上需要改变);
  • imu和camera之间的外参R,t;可选(0)已知精确的外参,运行中无需改变,(1)已知外参初值,运行中优化,(2)什么都不知道,在线初始化中标定
  • 闭环参数,包括brief描述子的pattern文件(前端视觉使用光流跟踪,不需要计算描述子),针对场景训练好的DBow二进制字典文件;
imu_topic: "/imu0"
image_topic: "/cam0/image_raw"

image_width: 752
image_height: 480

#optimization parameters
max_solver_time: 0.04  # max solver itration time (ms), to guarantee real time
max_num_iterations: 8   # max solver itrations, to guarantee real time
keyframe_parallax: 10.0 # keyframe selection threshold (pixel)

#imu parameters       The more accurate parameters you provide, the better performance
acc_n: 0.2          # accelerometer measurement noise standard deviation. #0.2
gyr_n: 0.02         # gyroscope measurement noise standard deviation.     #0.05
acc_w: 0.0002         # accelerometer bias random work noise standard deviation.  #0.02
gyr_w: 2.0e-5       # gyroscope bias random work noise standard deviation.     #4.0e-5
g_norm: 9.81007     # gravity magnitude

# Extrinsic parameter between IMU and Camera.
estimate_extrinsic: 1   # 0  Have an accurate extrinsic parameters. We will trust the following imu^R_cam, imu^T_cam, dont change it.
                        # 1  Have an initial guess about extrinsic parameters. We will optimize around your initial guess.
                        # 2  Dont know anything about extrinsic parameters. You dont need to give R,T. We will try to calibrate it. Do some rotation movement at beginning. 

#loop closure parameters
loop_closure: 1   #if you want to use loop closure to minimize the drift, set loop_closure true and give your brief pattern file path and vocabulary file path accordingly;
                     #also give the camera calibration file same as feature_tracker node
pattern_file: "/support_files/brief_pattern.yml"
voc_file: "/support_files/brief_k10L6.bin"
min_loop_num: 25

 

VINS(二)Feature Detection and Tracking