MetaWearIMUObserver.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/MetaWearIMU.h>
29 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
31 
32 #include <mutex>
33 
34 namespace armarx
35 {
36  /**
37  * \class MetaWearIMUObserverPropertyDefinitions
38  * \brief
39  */
42  {
43  public:
46  {
47  defineOptionalProperty<std::string>("MetaWearTopicName", "MetaWearData", "Name of the MetaWear topic");
48  defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
49  }
50  };
51 
52 
53 
55  virtual public Observer,
56  virtual public MetaWearIMUObserverInterface
57  {
58  public:
60 
61  std::string getDefaultName() const override
62  {
63  return "MetaWearIMUObserver";
64  }
65  void onInitObserver() override;
66  void onConnectObserver() override;
67  void onExitObserver() override;
68 
69  void reportIMUValues(const std::string& name, const MetaWearIMUData& data, const TimestampBasePtr& timestamp, const Ice::Current&) override;
70 
71  /**
72  * @see PropertyUser::createPropertyDefinitions()
73  */
75 
76 
77  private:
78  std::mutex dataMutex;
79  DebugDrawerInterfacePrx debugDrawerPrx;
80 
81  void offerVector3(const std::string& channelName, const std::string& dfName, const std::vector<float>& data);
82  void offerQuaternion(const std::string& channelName, const std::string& dfName, const std::vector<float>& data);
83 
84  };
85 }
86 
armarx::MetaWearIMUObserver::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: MetaWearIMUObserver.cpp:82
armarx::MetaWearIMUObserver::onConnectObserver
void onConnectObserver() override
Framework hook.
Definition: MetaWearIMUObserver.cpp:54
armarx::Observer
Baseclass for all ArmarX Observers.
Definition: Observer.h:80
Pose.h
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
Observer.h
armarx::MetaWearIMUObserverPropertyDefinitions::MetaWearIMUObserverPropertyDefinitions
MetaWearIMUObserverPropertyDefinitions(std::string prefix)
Definition: MetaWearIMUObserver.h:44
armarx::MetaWearIMUObserver::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: MetaWearIMUObserver.h:61
armarx::MetaWearIMUObserver::onExitObserver
void onExitObserver() override
Framework hook.
Definition: MetaWearIMUObserver.cpp:60
armarx::MetaWearIMUObserver::onInitObserver
void onInitObserver() override
Framework hook.
Definition: MetaWearIMUObserver.cpp:40
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::MetaWearIMUObserverPropertyDefinitions
Definition: MetaWearIMUObserver.h:40
armarx::MetaWearIMUObserver::reportIMUValues
void reportIMUValues(const std::string &name, const MetaWearIMUData &data, const TimestampBasePtr &timestamp, const Ice::Current &) override
Definition: MetaWearIMUObserver.cpp:65
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::MetaWearIMUObserver
Definition: MetaWearIMUObserver.h:54
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::MetaWearIMUObserver::MetaWearIMUObserver
MetaWearIMUObserver()
Definition: MetaWearIMUObserver.h:59
armarx::ObserverPropertyDefinitions
Definition: Observer.h:50
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28