目录
1.双目初始化部分
进入追踪线程首先判断双目追踪器状态mstate,在刚进入SLAM系统时,
Tracking::Tracking函数默认将其设置为NO_IMAGES_YET,系统经过reset时也会将mstate设置为NO_IMAGES_YET......如果是这种状态,将SLAM系统状态设置为未初始化状态NOT_INITIALIZED。
mLastProcessedState设置为mstate的值。
如果SLAM系统没有初始化,则执行双目初始化函数StereoInitialization。
void Tracking::StereoInitialization() { if(mCurrentFrame.N>500) { // Set Frame pose to the origin mCurrentFrame.SetPose(cv::Mat::eye(4,4,CV_32F)); // Create KeyFrame KeyFrame* pKFini = new KeyFrame(mCurrentFrame,mpMap,mpKeyFrameDB); // Insert KeyFrame in the map mpMap->AddKeyFrame(pKFini); // Create MapPoints and associate to KeyFrame for(int i=0; i<mCurrentFrame.N;i++) {