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 "HandLocalisation.h"
36 #include "Image/ByteImage.h"
37 #include "Threading/Mutex.h"
38 #include "Threading/Thread.h"
39 #include "Threading/Threading.h"
40 
41 namespace visionx
42 {
43  /**
44  * @class HandLocalisationThread
45  *
46  */
47  class HandLocalisationThread : public CThread
48  {
49  public:
50  HandLocalisationThread(int nNumParticles,
51  int nNumAnnealingRuns,
52  int nPredictionMode,
53  CStereoCalibration* pCalibration,
54  std::string sHandModelFileName);
55  ~HandLocalisationThread() override;
56 
57  bool IsProcessing();
58  bool HasResult();
59 
60  void GetResult(double* pEstimatedConfig, double& dConfidenceRating);
61  void Localise(const CByteImage* pNewCamImageLeft,
62  const CByteImage* pNewCamImageRight,
63  const double* pSensorConfig);
64 
65  int ThreadMethod() override;
66 
67  void Stop();
68 
70 
71  private:
72  bool m_bIsProcessing;
73  bool m_bHasResult;
74  bool m_bReadyForLocalising;
75 
76  CByteImage *m_pNewCamImageLeft, *m_pNewCamImageRight;
77  double* m_pSensorConfig;
78  double* m_pEstimatedConfig;
79  double m_dConfidenceRating;
80 
81  CMutex m_mMutex;
82 
83  bool m_bStopped;
84  };
85 } // namespace visionx
visionx::HandLocalisationThread::GetResult
void GetResult(double *pEstimatedConfig, double &dConfidenceRating)
Definition: HandLocalisationThread.cpp:84
visionx::HandLocalisationThread::IsProcessing
bool IsProcessing()
Definition: HandLocalisationThread.cpp:72
visionx::HandLocalisationThread::HasResult
bool HasResult()
Definition: HandLocalisationThread.cpp:78
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::HandLocalisationThread::m_pHandLocalisation
CHandLocalisation * m_pHandLocalisation
Definition: HandLocalisationThread.h:69
visionx::HandLocalisationThread
Definition: HandLocalisationThread.h:47
visionx::CHandLocalisation
Definition: HandLocalisation.h:71
visionx::HandLocalisationThread::Localise
void Localise(const CByteImage *pNewCamImageLeft, const CByteImage *pNewCamImageRight, const double *pSensorConfig)
Definition: HandLocalisationThread.cpp:101
HandLocalisation.h
visionx::HandLocalisationThread::Stop
void Stop()
Definition: HandLocalisationThread.cpp:65
visionx::HandLocalisationThread::ThreadMethod
int ThreadMethod() override
Definition: HandLocalisationThread.cpp:122
visionx::HandLocalisationThread::HandLocalisationThread
HandLocalisationThread(int nNumParticles, int nNumAnnealingRuns, int nPredictionMode, CStereoCalibration *pCalibration, std::string sHandModelFileName)
Definition: HandLocalisationThread.cpp:38
visionx::HandLocalisationThread::~HandLocalisationThread
~HandLocalisationThread() override
Definition: HandLocalisationThread.cpp:56