HandLocalisationThread.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 /*
25  * @file HandLocalisationThread.h
26  *
27  * @author David Schiebener
28  * @date 21.02.2010
29  */
30 
31 /* double include protection */
32 #pragma once
33 
34 /* includes */
35 #include "Threading/Thread.h"
36 #include "Threading/Threading.h"
37 #include "Threading/Mutex.h"
38 
39 #include "Image/ByteImage.h"
40 
41 #include "HandLocalisation.h"
42 
43 
44 
45 
46 
47 namespace visionx
48 {
49  /**
50  * @class HandLocalisationThread
51  *
52  */
53  class HandLocalisationThread: public CThread
54  {
55  public:
56  HandLocalisationThread(int nNumParticles, int nNumAnnealingRuns, int nPredictionMode, CStereoCalibration* pCalibration, std::string sHandModelFileName);
57  ~HandLocalisationThread() override;
58 
59  bool IsProcessing();
60  bool HasResult();
61 
62  void GetResult(double* pEstimatedConfig, double& dConfidenceRating);
63  void Localise(const CByteImage* pNewCamImageLeft, const CByteImage* pNewCamImageRight, const double* pSensorConfig);
64 
65  int ThreadMethod() override;
66 
67  void Stop();
68 
70 
71  private:
72 
73  bool m_bIsProcessing;
74  bool m_bHasResult;
75  bool m_bReadyForLocalising;
76 
77  CByteImage* m_pNewCamImageLeft, *m_pNewCamImageRight;
78  double* m_pSensorConfig;
79  double* m_pEstimatedConfig;
80  double m_dConfidenceRating;
81 
82  CMutex m_mMutex;
83 
84  bool m_bStopped;
85  };
86 }
87 
visionx::HandLocalisationThread::GetResult
void GetResult(double *pEstimatedConfig, double &dConfidenceRating)
Definition: HandLocalisationThread.cpp:82
visionx::HandLocalisationThread::IsProcessing
bool IsProcessing()
Definition: HandLocalisationThread.cpp:70
visionx::HandLocalisationThread::HasResult
bool HasResult()
Definition: HandLocalisationThread.cpp:76
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::HandLocalisationThread::m_pHandLocalisation
CHandLocalisation * m_pHandLocalisation
Definition: HandLocalisationThread.h:69
visionx::HandLocalisationThread
Definition: HandLocalisationThread.h:53
visionx::CHandLocalisation
Definition: HandLocalisation.h:72
visionx::HandLocalisationThread::Localise
void Localise(const CByteImage *pNewCamImageLeft, const CByteImage *pNewCamImageRight, const double *pSensorConfig)
Definition: HandLocalisationThread.cpp:99
HandLocalisation.h
visionx::HandLocalisationThread::Stop
void Stop()
Definition: HandLocalisationThread.cpp:63
visionx::HandLocalisationThread::ThreadMethod
int ThreadMethod() override
Definition: HandLocalisationThread.cpp:120
visionx::HandLocalisationThread::HandLocalisationThread
HandLocalisationThread(int nNumParticles, int nNumAnnealingRuns, int nPredictionMode, CStereoCalibration *pCalibration, std::string sHandModelFileName)
Definition: HandLocalisationThread.cpp:40
visionx::HandLocalisationThread::~HandLocalisationThread
~HandLocalisationThread() override
Definition: HandLocalisationThread.cpp:54