Project

General

Profile

BitmapToolkit Scol plugin
sSlam_orb.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __BTK_SSLAM_H__
26#define __BTK_SSLAM_H__
27
28#include "Prerequisites.h"
29#include "ArCameraParam.h"
30#include "ArManager.h"
31#include "BitmapToolkitThread.h"
32
33#include "ORB_SLAM2/System.h"
34#include "ORB_SLAM2/Parameters.h"
35
36class Plane
37{
38public:
39 Plane() {}
40 cv::Mat DetectPlane(const cv::Mat Tcw, const std::vector<ORB_SLAM2::MapPoint*> &vMPs, const int iterations);
41 void Recompute();
42
43 //normal
44 cv::Mat mNormal;
45 //origin
46 cv::Mat mOrigin;
47 //arbitrary orientation along normal
48 float mRang;
49 //transformation from world to the plane
50 cv::Mat mTpw;
51 //MapPoints that define the plane
52 std::vector<ORB_SLAM2::MapPoint*> mMvMPs;
53 //camera pose when the plane was first observed (to compute normal direction)
54 cv::Mat mMTcw, mXC;
55};
56
58{
59public:
62protected:
63
64private:
65 ORB_SLAM2::Parameters mParams;
66 ORB_SLAM2::ORBVocabulary* mVocabulary;
67 LASTDATA mLastData;
68 boost::recursive_mutex mUpdateMutex;
69 ORB_SLAM2::System* mSlam;
70 Vector3 mLastCamPos;
71 BtQuaternion mLastCamQuat;
72 cv::Mat mPlane2World;
73 cv::Mat mPlane2Camera;
74 cv::Mat mCentroid;
75 double mTimestamp;
76 float mScale;
77 bool mIsDirty;
78 bool mFound;
79 bool mInitialized;
80 int mFullInit;
81 void BuildCameraParam(const aruco::CameraParameters &camparam);
82 void InitDetector();
83 void Detect();
84
85public:
86 bool needUpdate;
87 void GoThread();
88 void SetDirty();
91 bool IsFound();
92 void Reset();
93 void DrawLandmarks(cv::Mat image);
94protected:
95
96private:
97};
98
99#endif
Definition sSlam.h:52
cv::Mat mMTcw
Definition sSlam.h:69
float mRang
Definition sSlam.h:63
cv::Mat mXC
Definition sSlam.h:70
cv::Mat mTpw
Definition sSlam.h:65
cv::Mat DetectPlane(cv::Mat campos, std::vector< slamPoint > &vMPs, const int iterations)
Definition sSlam.cpp:135
std::vector< ORB_SLAM2::MapPoint * > mMvMPs
Definition sSlam_orb.h:52
Plane()
Definition sSlam_orb.h:39
cv::Mat mOrigin
Definition sSlam.h:61
void Recompute()
cv::Mat mNormal
Definition sSlam.h:59
Definition sSlam.h:74
BtQuaternion GetCameraOrientation()
void SetDirty()
bool needUpdate
Definition sSlam.h:128
Vector3 GetCameraPosition()
void GoThread()
bool IsFound()
void DrawLandmarks(cv::Mat image)
void Reset()