逻辑框架——要素图
逻辑框架——流程图——>初始化状态
逻辑框架——流程图——>正常运转状态
头文件——/slam14/project/0.2/include/myslam/visual_odometry.h
/*
* <one line to give the program's name and a brief idea of what it does.>
* Copyright (C) 2016 <copyright holder> <email>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef VISUALODOMETRY_H
#define VISUALODOMETRY_H
#include "myslam/common_include.h"
#include "myslam/map.h"
#include <opencv2/features2d/features2d.hpp>
namespace myslam
{
class VisualOdometry
{
public:
typedef shared_ptr<VisualOdometry> Ptr;
//枚举表征VO状态,初始化、正常、丢失
enum VOState {
INITIALIZING=-1,
OK=0,
LOST
};
//VO状态、地图(关键帧和特征点)、参考帧、当前帧
VOState state_; // current VO status
Map::Ptr map_; // map with all frames and map points
Frame::Ptr ref_; // reference frame
Frame::Ptr curr_; // current frame
//orb、当前帧特征点KeyPoint、当前帧描述子、参考帧3D坐标Point3f、参考帧描述子、匹配关系
cv::Ptr<cv::ORB> orb_; // orb detector and computer
// 当前帧的关键点,描述子存放位置
vector<cv::KeyPoint> keypoints_curr_; // keypoints in current frame
Mat descriptors_curr_; // descriptor in current frame
// 引用帧关键点,描述子存放位置
vector<cv::Point3f> pts_3d_ref_; // 3d points in reference frame
Mat descriptors_ref_; // descriptor in reference frame
// 当前帧vs引用帧匹配结果存放位置
vector<cv::DMatch> feature_matches_;
//位姿估计T、内点数(即为匹配出的关键点数量)、丢失数
SE3 T_c