InertialMeasurementUnitObserver.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 <RobotAPI/interface/units/InertialMeasurementUnit.h>
29 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
31 
32 #include <mutex>
33 
34 namespace armarx
35 {
36  /**
37  * \class InertialMeasurementUnitObserverPropertyDefinitions
38  * \brief
39  */
42  {
43  public:
46  {
47  defineOptionalProperty<std::string>("IMUTopicName", "IMUValues", "Name of the IMU Topic.");
48  defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
49  defineOptionalProperty<bool>("EnableVisualization", true, "Enable/Disable DebugDrawer visualizations");
50  }
51  };
52 
53 
54  /**
55  * \class InertialMeasurementUnitObserver
56  * \ingroup RobotAPI-SensorActorUnits-observers
57  * \brief Observer monitoring @IMU sensor values
58  *
59  * The InertialMeasurementUnitObserver monitors @IMU sensor values published by InertialMeasurementUnit-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 InertialMeasurementUnitObserverInterface
65  {
66  public:
68 
69  std::string getDefaultName() const override
70  {
71  return "InertialMeasurementUnitObserver";
72  }
73  void onInitObserver() override;
74  void onConnectObserver() override;
75  void onExitObserver() override;
76 
77  void reportSensorValues(const std::string& device, const std::string& name, const IMUData& values, const TimestampBasePtr& timestamp, const Ice::Current& c = Ice::emptyCurrent) override;
78 
79  /**
80  * @see PropertyUser::createPropertyDefinitions()
81  */
83 
84 
85  private:
86  std::mutex dataMutex;
87  DebugDrawerInterfacePrx debugDrawerPrx;
88 
89 
90  void offerValue(const std::string& device, const std::string& fieldName, const Vector3Ptr& vec);
91  };
92 }
93 
armarx::Observer
Baseclass for all ArmarX Observers.
Definition: Observer.h:80
armarx::InertialMeasurementUnitObserverPropertyDefinitions::InertialMeasurementUnitObserverPropertyDefinitions
InertialMeasurementUnitObserverPropertyDefinitions(std::string prefix)
Definition: InertialMeasurementUnitObserver.h:44
Pose.h
armarx::InertialMeasurementUnitObserver::onInitObserver
void onInitObserver() override
Framework hook.
Definition: InertialMeasurementUnitObserver.cpp:38
armarx::InertialMeasurementUnitObserver::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: InertialMeasurementUnitObserver.cpp:147
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
Observer.h
IceInternal::Handle< Vector3 >
armarx::InertialMeasurementUnitObserver::reportSensorValues
void reportSensorValues(const std::string &device, const std::string &name, const IMUData &values, const TimestampBasePtr &timestamp, const Ice::Current &c=Ice::emptyCurrent) override
Definition: InertialMeasurementUnitObserver.cpp:70
armarx::InertialMeasurementUnitObserver
Observer monitoring @IMU sensor values.
Definition: InertialMeasurementUnitObserver.h:62
armarx::InertialMeasurementUnitObserver::InertialMeasurementUnitObserver
InertialMeasurementUnitObserver()
Definition: InertialMeasurementUnitObserver.h:67
armarx::InertialMeasurementUnitObserver::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: InertialMeasurementUnitObserver.h:69
armarx::InertialMeasurementUnitObserver::onExitObserver
void onExitObserver() override
Framework hook.
Definition: InertialMeasurementUnitObserver.cpp:61
armarx::InertialMeasurementUnitObserverPropertyDefinitions
Definition: InertialMeasurementUnitObserver.h:40
IceUtil::Handle
Definition: forward_declarations.h:29
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::InertialMeasurementUnitObserver::onConnectObserver
void onConnectObserver() override
Framework hook.
Definition: InertialMeasurementUnitObserver.cpp:53
armarx::ObserverPropertyDefinitions
Definition: Observer.h:50
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28