MetaWearIMU.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotAPI::ArmarXObjects::MetaWearIMU
17  * @author Lukas Kaul ( lukas dot s dot kaul at gmail dot com )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "MetaWearIMU.h"
24 
26 
27 
28 using namespace armarx;
29 
30 
32 {
33  usingTopic(getProperty<std::string>("MetaWearPythonTopicName"));
34  offeringTopic(getProperty<std::string>("MetaWearTopicName"));
35 }
36 
37 
39 {
40  topicPrx = getTopic<MetaWearIMUListenerPrx>(getProperty<std::string>("MetaWearTopicName").getValue());
41 }
42 
43 
45 {
46 
47 }
48 
49 
51 {
52 
53 }
54 
56 {
59 }
60 
61 
62 
63 void armarx::MetaWearIMU::reportIMUValues(const std::string& name, const MetaWearIMUDataExt& data_ext, const Ice::Current&)
64 {
65  IceUtil::Time now = IceUtil::Time::now();
66  TimestampVariantPtr nowTimestamp = new TimestampVariant(now);
67  MetaWearIMUData data;
68  data.acceleration = data_ext.acceleration;
69  data.gyro = data_ext.gyro;
70  data.magnetic = data_ext.magnetic;
71  data.orientationQuaternion = data_ext.orientationQuaternion;
72  topicPrx->reportIMUValues(name, data, nowTimestamp);
73 }
armarx::MetaWearIMUPropertyDefinitions
Definition: MetaWearIMU.h:36
armarx::MetaWearIMU::onInitComponent
void onInitComponent() override
Definition: MetaWearIMU.cpp:31
armarx::TimestampVariant
Definition: TimestampVariant.h:54
armarx::MetaWearIMU::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: MetaWearIMU.cpp:55
armarx::MetaWearIMU::onDisconnectComponent
void onDisconnectComponent() override
Definition: MetaWearIMU.cpp:44
armarx::MetaWearIMU::reportIMUValues
void reportIMUValues(const std::string &name, const MetaWearIMUDataExt &data_ext, const Ice::Current &) override
Definition: MetaWearIMU.cpp:63
IceInternal::Handle< TimestampVariant >
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
TimestampVariant.h
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::MetaWearIMU::onExitComponent
void onExitComponent() override
Definition: MetaWearIMU.cpp:50
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:290
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::MetaWearIMU::topicPrx
MetaWearIMUListenerPrx topicPrx
Definition: MetaWearIMU.h:99
armarx::MetaWearIMU::onConnectComponent
void onConnectComponent() override
Definition: MetaWearIMU.cpp:38
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
MetaWearIMU.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28