OptoForceUnitObserver.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-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 RobotAPI::units
19  * @author David Schiebener <schiebener at kit dot edu>
20  * @date 2014
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <mutex>
28 
30 
31 #include <RobotAPI/interface/units/OptoForceUnit.h>
32 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
34 
35 namespace armarx
36 {
37  /**
38  * \class OptoForceUnitObserverPropertyDefinitions
39  * \brief
40  */
42  {
43  public:
46  {
47  defineOptionalProperty<std::string>(
48  "OptoForceTopicName", "OptoForceValues", "Name of the OptoForce Topic");
49  defineOptionalProperty<std::string>(
50  "DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
51  }
52  };
53 
54  /**
55  * \class OptoForceUnitObserver
56  * \ingroup RobotAPI-SensorActorUnits-observers
57  * \brief Observer monitoring @IMU sensor values
58  *
59  * The OptoForceUnitObserver monitors @IMU sensor values published by OptoForceUnit-implementations and offers condition checks on these values.
60  * Available condition checks are: *updated*, *larger*, *equals* and *smaller*.
61  */
63  virtual public Observer,
64  virtual public OptoForceUnitObserverInterface
65  {
66  public:
68  {
69  }
70 
71  std::string
72  getDefaultName() const override
73  {
74  return "OptoForceUnitObserver";
75  }
76 
77  void onInitObserver() override;
78  void onConnectObserver() override;
79  void onExitObserver() override;
80 
81  void reportSensorValues(const std::string& device,
82  const std::string& name,
83  float fx,
84  float fy,
85  float fz,
86  const TimestampBasePtr& timestamp,
87  const Ice::Current& c = Ice::emptyCurrent) override;
88 
89  /**
90  * @see PropertyUser::createPropertyDefinitions()
91  */
93 
94 
95  private:
96  std::mutex dataMutex;
97  DebugDrawerInterfacePrx debugDrawerPrx;
98 
99 
100  void offerValue(std::string device, std::string fieldName, Vector3Ptr vec);
101  };
102 } // namespace armarx
armarx::OptoForceUnitObserver::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: OptoForceUnitObserver.h:72
armarx::OptoForceUnitObserver
Observer monitoring @IMU sensor values.
Definition: OptoForceUnitObserver.h:62
armarx::Observer
Baseclass for all ArmarX Observers.
Definition: Observer.h:84
Pose.h
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::OptoForceUnitObserver::onInitObserver
void onInitObserver() override
Framework hook.
Definition: OptoForceUnitObserver.cpp:37
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
Observer.h
armarx::OptoForceUnitObserver::reportSensorValues
void reportSensorValues(const std::string &device, const std::string &name, float fx, float fy, float fz, const TimestampBasePtr &timestamp, const Ice::Current &c=Ice::emptyCurrent) override
Definition: OptoForceUnitObserver.cpp:64
IceInternal::Handle< Vector3 >
timestamp
std::string timestamp()
Definition: CartographerAdapter.cpp:85
armarx::OptoForceUnitObserverPropertyDefinitions::OptoForceUnitObserverPropertyDefinitions
OptoForceUnitObserverPropertyDefinitions(std::string prefix)
Definition: OptoForceUnitObserver.h:44
armarx::OptoForceUnitObserverPropertyDefinitions
Definition: OptoForceUnitObserver.h:41
armarx::OptoForceUnitObserver::onConnectObserver
void onConnectObserver() override
Framework hook.
Definition: OptoForceUnitObserver.cpp:50
armarx::OptoForceUnitObserver::OptoForceUnitObserver
OptoForceUnitObserver()
Definition: OptoForceUnitObserver.h:67
IceUtil::Handle
Definition: forward_declarations.h:30
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::OptoForceUnitObserver::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: OptoForceUnitObserver.cpp:146
armarx::OptoForceUnitObserver::onExitObserver
void onExitObserver() override
Framework hook.
Definition: OptoForceUnitObserver.cpp:57
armarx::ObserverPropertyDefinitions
Definition: Observer.h:49
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27