Project

General

Profile

BitmapToolkit Scol plugin
sSlam_sd.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 "SD_SLAM/System.h"
34#include "SD_SLAM/Config.h"
35
36class Plane
37{
38public:
39 Plane() {}
40 cv::Mat DetectPlane(const cv::Mat Tcw, const std::vector<SD_SLAM::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<SD_SLAM::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 LASTDATA mLastData;
66 boost::recursive_mutex mUpdateMutex;
67 SD_SLAM::System* mSlam;
68 Vector3 mLastCamPos;
69 BtQuaternion mLastCamQuat;
70 cv::Mat mPlane2World;
71 cv::Mat mPlane2Camera;
72 cv::Mat mCameraWorld;
73 cv::Mat mCentroid;
74 std::chrono::steady_clock::time_point mTimestamp;
75 float mScale;
76 bool mIsDirty;
77 bool mFound;
78 bool mInitialized;
79 int mFullInit;
80 void BuildCameraParam(const aruco::CameraParameters &camparam);
81 void InitDetector();
82 void Detect();
83
84public:
85 bool needUpdate;
86 void GoThread();
87 void SetDirty();
90 bool IsFound();
91 void Reset();
92 void DrawLandmarks(cv::Mat image);
93protected:
94
95private:
96};
97
98#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
std::vector< SD_SLAM::MapPoint * > mMvMPs
Definition sSlam_sd.h:52
cv::Mat DetectPlane(cv::Mat campos, std::vector< slamPoint > &vMPs, const int iterations)
Definition sSlam.cpp:135
Plane()
Definition sSlam_sd.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()