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
28using namespace armarx;
29
30void
32{
33 usingTopic(getProperty<std::string>("MetaWearPythonTopicName"));
34 offeringTopic(getProperty<std::string>("MetaWearTopicName"));
35}
36
37void
43
44void
48
49void
53
60
61void
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}
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
void onInitComponent() override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void reportIMUValues(const std::string &name, const MetaWearIMUDataExt &data_ext, const Ice::Current &) override
void onConnectComponent() override
MetaWearIMUListenerPrx topicPrx
void onExitComponent() override
Implements a Variant type for timestamps.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceInternal::Handle< TimestampVariant > TimestampVariantPtr