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 void
32 {
33  usingTopic(getProperty<std::string>("MetaWearPythonTopicName"));
34  offeringTopic(getProperty<std::string>("MetaWearTopicName"));
35 }
36 
37 void
39 {
40  topicPrx =
41  getTopic<MetaWearIMUListenerPrx>(getProperty<std::string>("MetaWearTopicName").getValue());
42 }
43 
44 void
46 {
47 }
48 
49 void
51 {
52 }
53 
56 {
59 }
60 
61 void
62 armarx::MetaWearIMU::reportIMUValues(const std::string& name,
63  const MetaWearIMUDataExt& data_ext,
64  const Ice::Current&)
65 {
66  IceUtil::Time now = IceUtil::Time::now();
67  TimestampVariantPtr nowTimestamp = new TimestampVariant(now);
68  MetaWearIMUData data;
69  data.acceleration = data_ext.acceleration;
70  data.gyro = data_ext.gyro;
71  data.magnetic = data_ext.magnetic;
72  data.orientationQuaternion = data_ext.orientationQuaternion;
73  topicPrx->reportIMUValues(name, data, nowTimestamp);
74 }
armarx::MetaWearIMUPropertyDefinitions
Definition: MetaWearIMU.h:37
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:45
armarx::MetaWearIMU::reportIMUValues
void reportIMUValues(const std::string &name, const MetaWearIMUDataExt &data_ext, const Ice::Current &) override
Definition: MetaWearIMU.cpp:62
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:254
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
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:300
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::MetaWearIMU::topicPrx
MetaWearIMUListenerPrx topicPrx
Definition: MetaWearIMU.h:103
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:35
MetaWearIMU.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27