Overview

欢迎访问 https://cgabc.xyz/posts/1df60b35/,持续更新

  • Alg. PDF: Formula Derivation and Code Analysis of S-MSCKF

  • Code: 本文

1. ImageProcessor

initialize

  • loadParameters
  • create FastFeatureDetector

imuCallback

  • imu_msg_buffer.push_back(*msg) after the first image

stereoCallback

  • get stereo mono images and timestamps

  • createImagePyramids

    • buildOpticalFlowPyramid for cam0_img and cam1_img
  • initializeFirstFrame

    • detect new_features on the frist cam0_img --> cam0_points
    • stereoMatch
      • cam0_points --> cam1_points and inlier_markers
    • get cam0_inliers, cam1_inliers and response_inliers
    • Group the features into grids: grid_new_features
    • sort by ImageProcessor::featureCompareByResponse
    • Collect new features within each grid with high response --> curr_features_ptr
  • trackFeatures

    • integrateImuData: compute a rough relative rotation cam0_R_p_c and cam1_R_p_c

      • 用两帧图像之间的IMU数据,通过积分计算两帧图像的相对旋转矩阵cam0_R_p_c,cam1_R_p_c,直接对角速度进行积分获得旋转矢量,然后用罗德里格斯公式转化成旋转矩阵
    • Organize the features in the previous image: prev_cam0_points and prev_cam1_points
    • predictFeatureTracking
      • prev_cam0_points --> curr_cam0_points
      • H = K * cam0_R_p_c * K.inv(), p2 = H * p1
    • calcOpticalFlowPyrLK
      • prev_cam0_points --> curr_cam0_points and track_inliers
    • stereoMatch
      • curr_tracked_cam0_points --> curr_cam1_points and match_inliers
    • twoPointRansac: remove outliers
      • prev_matched_cam0_points and curr_matched_cam0_points --> cam0_ransac_inliers
      • prev_matched_cam1_points and curr_matched_cam1_points --> cam0_ransac_inliers
    • curr_matched_cam0_points and curr_matched_cam1_points --> curr_features_ptr
  • addNewFeatures

    • Create a mask to avoid redetecting existing features
    • Detect new_features with mask
    • Collect the new detected features based on the grid new_feature_sieve
    • Select the ones with top response within each grid afterwards and add to new_features --> cam0_points
    • stereoMatch
      • cam0_points --> cam1_points and inlier_markers
    • get cam0_inliers, cam1_inliers and response_inliers
    • Group the features into grids grid_new_features
    • sort by ImageProcessor::featureCompareByResponse
    • Collect new features within each grid with high response --> curr_features_ptr
  • pruneGridFeatures

    • sort by ImageProcessor::featureCompareByLifetime
    • Remove some of the features of a grid by processor_config.grid_max_feature_num
  • publish

    • curr_cam0_points_undistorted[x,y]
    • curr_cam1_points_undistorted[x,y]

sub func/algms

  • stereoMatch: cam0_points --> cam1_points and inlier_markers

    • Initialize cam1_points by projecting cam0_points to cam1 using the rotation from stereo extrinsics R_cam0_cam1 = R_cam1_imu.t() * R_cam0_imu
    • calcOpticalFlowPyrLK: cam0_points --> cam1_points and inlier_markers
    • remove outliers: compute the essential matrix E --> inlier_markers

2. MsckfVio

initialize

  • loadParameters
  • Initialize state server
    • state_server.continuous_noise_cov
  • Initialize the chi squared test table with confidence level 0.95
    • chi_squared_test_table

imuCallback

  • initializeGravityAndBias

    • 将前200帧加速度和角速度求平均
    • IMUState::gravity: 平均加速度的模值g作为重力加速度
    • state_server.imu_state.gyro_bias: 平均角速度作为陀螺仪的bias
    • state_server.imu_state.orientation: 计算重力向量(0,0,-g)和平均加速度之间的夹角(旋转四元数), 标定初始时刻IMU系与world系之间的夹角
    • 因此MSCKF要求前200帧IMU是静止不动的

featureCallback

  • 第一帧时间戳给 state_server.imu_state.time

  • batchImuProcessing(传播IMU状态,处理两帧图像之间的所有IMU观测数据)

    • processModel(每帧IMU数据)

      • 状态向量预测 predictNewState:姿态预测、速度和位置预测
      • 状态协方差预测
    • state_server.imu_state.id = IMUState::next_id++;
    • Remove all used IMU msgs
  • stateAugmentation

    • 状态向量扩增
    • 协方差扩增
  • addFeatureObservations

    • 将特征添加到map_server, 将特征添加到对应feature.id的observations(std::map)中
    • 计算跟踪已有特征的比例,get tracking_rate
  • removeLostFeatures(特征跟丢了需要移除特征)

    • Remove the features that lost track from map_server and get jacobian_row_size

      • checkMotion
      • initializePosition
    • featureJacobian
    • gatingTest why
    • measurementUpdate
    • Remove all processed features from the map
  • pruneCamStateBuffer(相机状态数量达到最大限制max_cam_state_size需要剔除掉相机状态)

    • Find two camera states to be removed findRedundantCamStates

      • rotation_threshold, translation_threshold, tracking_rate_threshold
      • sort(rm_cam_state_ids.begin(), rm_cam_state_ids.end());
    • remove feature.observations and get jacobian_row_size
      • checkMotion
      • initializePosition
    • featureJacobian
    • gatingTest why
    • measurementUpdate
    • remove
      • Remove the corresponding rows and columns in the state covariance matrix
      • Remove this camera state in the state vector
  • publish

    • odom: Eigen::Isometry3d T_b_w = IMUState::T_imu_body * T_i_w * IMUState::T_imu_body.inverse();
    • 3D points: feature_msg_ptr->points

sub func/algms

  • initializePosition

    • trianglation: generateInitialGuess
    • L-M --> position
  • featureJacobian

    • Check how many camera states in the provided camera id camera has actually seen this feature
    • measurementJacobian
      • (why) Modifty the measurement Jacobian to ensure observability constrain
    • Project the residual and Jacobians onto the nullspace of H_fj

S-MSCKF 论文公式推导与代码解析相关推荐

  1. 后端优化 | VINS-Mono 论文公式推导与代码解析分讲

    3. 后端优化(紧耦合) VIO 紧耦合方案的主要思路就是通过将基于视觉构造的残差项和基于IMU构造的残差项放在一起构造成一个联合优化的问题,整个优化问题的最优解即可认为是比较准确的状态估计. 为了限 ...

  2. 单目标跟踪算法:Siamese RPN论文解读和代码解析

    点击上方"3D视觉工坊",选择"星标" 干货第一时间送达 作者:周威 | 来源:知乎 https://zhuanlan.zhihu.com/p/16198364 ...

  3. Longformer论文解读和代码解析

    前言 这篇博文记录了longformer论文的主要思想.代码实现和结果复现方面的一些工作,相关链接如下: 原longformer论文地址 github上原作者公开的代码 huggingface上原作者 ...

  4. Inception V3论文解读和代码解析

    目录 论文解读 代码解析 小结 论文解读 在介绍inception V2时提到过,inception V3的论文依据是Rethinking the Inception Architecture for ...

  5. PointNet论文解读和代码解析

    目录 一.论文动机 现有的问题: 作者的思路及面临的问题: 二.论文方法 如何解决点云无序性问题?作者提出了三种想法. 针对点云的刚体运动不变性 三.网络结构 四.代码阅读 五.Reference(两 ...

  6. MSCKF理论推导与代码解析

    点击上方"3D视觉工坊",选择"星标" 干货第一时间送达 在SLAM后端中,主要有两种主流方法用于优化:基于滤波的方法和基于非线性的方法.基于滤波的方法主要有M ...

  7. 【单目3D目标检测】MonoDLE论文精读与代码解析

    文章目录 Preface Abstract Contributions Diagnostic Experiments Pipeline Revisiting Center Detection Trai ...

  8. 【单目3D目标检测】MonoFlex论文精读与代码解析

    文章目录 Preface Abstract Contributions Pipeline Problem Definition Decoupled Representations of Objects ...

  9. YOLOv7来临:论文解读附代码解析

    前言: 是一份关于YOLOv7的论文解读,首发于[GiantPandaCV]公众号,写的不是很好,望大佬们包涵! 2022年7月,YOLOv7来临, 论文链接:https://arxiv.org/ab ...

  10. GLMP:任务型对话中全局到局部的记忆指针网络 论文阅读及代码解析

    UPDATE 11.6.2020 复习代码,修正部分内容,清晰化部分表述.如发现问题,欢迎留言讨论! 文章目录 UPDATE GLMP ABSTRACT 1.INTRODUCTION 2.GLMP M ...

最新文章

  1. bash: /usr/lib/jvm/jdk1.7.0_80/bin/java: No such file or directory 问题
  2. Laravel5.5重写实现未通过认证(多用户)跳转相应登陆页面
  3. 微软管理控制台学习和创建自己的管理控制台
  4. 【Java自顶向下】试手小公司,面试官问我ConcurrentHashMap,我微微一笑……
  5. 《王者荣耀》游戏技术总监:技术架构与同步方案上做出改变?
  6. 元组-元组变量的常用操作
  7. QQ旋风爆缓冲区溢出漏洞
  8. 发送邮件时,如何附带上中文等价名信息
  9. Day-5: Python高级特性
  10. easyui datagrid中添加右键菜单事件
  11. [Tizen开发]SDB调试工具使用简介
  12. coolfire文章之三
  13. 推荐5款你用过之后不舍得卸载的小众软件
  14. zcu102_14_Zynq在Standalone下使用uGUI
  15. win10删除多余账户_Win10系统如何删除账户?Win10系统删除账户的方法
  16. Java 阿里云实人认证
  17. 【iOS开发】—— 通过URL Scheme调用外部地图软件
  18. 软考备考-系统构架师-18-信息系统基础知识相关试题整理
  19. 原生JS实现贪吃蛇游戏
  20. math.pi java 是多少_math.pi 180 多少

热门文章

  1. 思科模拟器完成实验报告
  2. Photoshop脚本 设置前景色和背景色
  3. 覆盖率验证——代码覆盖率+功能覆盖率
  4. typecho与WordPress博客程序评测及推荐
  5. 监考噩梦!!!(线上考试)
  6. 怎样取消QQ的热键(快捷键)
  7. python根据手表货号从腕表之家网站爬取相应信息
  8. 国家官宣!硕士补贴30W、本科补贴20W!一线城市户口,最高5W生活补贴丨毕业去这些城市,太太太爽了!...
  9. HTML5系列代码:Visual Studio Code(简称 VS Code)是一个由微软开发
  10. 逻辑学是计算机 创始人,逻辑学的创始人:亚里士多德