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
41namespace 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
HandLocalisationThread(int nNumParticles, int nNumAnnealingRuns, int nPredictionMode, CStereoCalibration *pCalibration, std::string sHandModelFileName)
void Localise(const CByteImage *pNewCamImageLeft, const CByteImage *pNewCamImageRight, const double *pSensorConfig)
void GetResult(double *pEstimatedConfig, double &dConfidenceRating)
ArmarX headers.