KinectAndCameraCalibrationObserver.cpp
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  */
25 
27 
28 namespace visionx
29 {
30  void
32  {
33  usingTopic("KinectAndCameraCalibration");
34  }
35 
36  void
38  {
39  offerChannel("calibrationResult",
40  "Gives information of KinectAndCameraCalibration process.");
41  //offerDataField("calibrationResult", "calibrationFinished", armarx::VariantType::Bool, "Is true when the calibration successfully finished, false if the calibration failed.");
42  armarx::Variant defaultValue(0);
44  "calibrationResult",
45  "calibrationFinished",
46  defaultValue,
47  "Is 1 when the calibration successfully finished, -1 if the calibration failed.");
49  }
50 
51  void
53  {
54  if (result)
55  {
56  ARMARX_IMPORTANT << "Calibration between the kinect and camera successfully finished.";
57  setDataField("calibrationResult", "calibrationFinished", 1);
58  }
59  else
60  {
61  ARMARX_IMPORTANT << "Calibration between the kinect and camera failed.";
62  setDataField("calibrationResult", "calibrationFinished", -1);
63  }
64 
65  updateChannel("calibrationResult");
66  }
67 
68 } // namespace visionx
armarx::Observer::updateChannel
void updateChannel(const std::string &channelName, const std::set< std::string > &updatedDatafields=std::set< std::string >())
Update all conditions for a channel.
Definition: Observer.cpp:788
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:223
visionx::KinectAndCameraCalibrationObserver::reportCalibrationFinished
void reportCalibrationFinished(bool result, const Ice::Current &) override
Definition: KinectAndCameraCalibrationObserver.cpp:52
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:190
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
ConditionCheckEquals.h
armarx::Observer::setDataField
void setDataField(const std::string &channelName, const std::string &datafieldName, const Variant &value, bool triggerFilterUpdate=true)
set datafield with datafieldName and in channel channelName
Definition: Observer.cpp:508
visionx::KinectAndCameraCalibrationObserver::onConnectObserver
void onConnectObserver() override
Framework hook.
Definition: KinectAndCameraCalibrationObserver.cpp:37
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:254
armarx::ConditionCheckEquals
Definition: ConditionCheckEquals.h:46
visionx::KinectAndCameraCalibrationObserver::onInitObserver
void onInitObserver() override
Framework hook.
Definition: KinectAndCameraCalibrationObserver.cpp:31
armarx::Observer::offerConditionCheck
void offerConditionCheck(std::string checkName, ConditionCheck *conditionCheck)
Offer a condition check.
Definition: Observer.cpp:301
armarx::Observer::offerDataFieldWithDefault
void offerDataFieldWithDefault(std::string channelName, std::string datafieldName, const Variant &defaultValue, std::string description)
Offer a datafield with default value.
Definition: Observer.cpp:160
KinectAndCameraCalibrationObserver.h
armarx::Observer::offerChannel
void offerChannel(std::string channelName, std::string description)
Offer a channel.
Definition: Observer.cpp:131