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 <mutex>
28
30
31#include <RobotAPI/interface/units/InertialMeasurementUnit.h>
32#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
34
35namespace armarx
36{
37 /**
38 * \class InertialMeasurementUnitObserverPropertyDefinitions
39 * \brief
40 */
42 {
43 public:
46 {
48 "IMUTopicName", "IMUValues", "Name of the IMU Topic.");
50 "DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
52 "EnableVisualization", true, "Enable/Disable DebugDrawer visualizations");
53 }
54 };
55
56 /**
57 * \class InertialMeasurementUnitObserver
58 * \ingroup RobotAPI-SensorActorUnits-observers
59 * \brief Observer monitoring @IMU sensor values
60 *
61 * The InertialMeasurementUnitObserver monitors @IMU sensor values published by InertialMeasurementUnit-implementations and offers condition checks on these values.
62 * Available condition checks are: *updated*, *larger*, *equals* and *smaller*.
63 */
65 virtual public Observer,
66 virtual public InertialMeasurementUnitObserverInterface
67 {
68 public:
72
73 std::string
74 getDefaultName() const override
75 {
76 return "InertialMeasurementUnitObserver";
77 }
78
79 void onInitObserver() override;
80 void onConnectObserver() override;
81 void onExitObserver() override;
82
83 void reportSensorValues(const std::string& device,
84 const std::string& name,
85 const IMUData& values,
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
101 offerValue(const std::string& device, const std::string& fieldName, const Vector3Ptr& vec);
102 };
103} // namespace armarx
std::string timestamp()
constexpr T c
void reportSensorValues(const std::string &device, const std::string &name, const IMUData &values, const TimestampBasePtr &timestamp, const Ice::Current &c=Ice::emptyCurrent) override
PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
ObserverPropertyDefinitions(std::string prefix)
Definition Observer.h:52
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Vector3 > Vector3Ptr
Definition Pose.h:165
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx