2#include <yarp/os/Property.h>
3#include <yarp/os/LogStream.h>
24 if (config.check(
"subdevice") && config.find(
"subdevice").isString())
27 ok &= config.check(
"proxy_remote");
28 ok &= config.check(
"proxy_local");
29 ok &= config.find(
"proxy_remote").isString();
30 ok &= config.find(
"proxy_local").isString();
33 yError()<<
"PassThroughInertial: proxy conf malformed";
36 auto subdeviceName = config.find(
"subdevice").asString();
37 yarp::os::Property masClientProp;
38 masClientProp.fromString(config.toString());
39 masClientProp.put(
"device", subdeviceName);
40 masClientProp.put(
"local", config.find(
"proxy_local").asString());
41 masClientProp.put(
"remote", config.find(
"proxy_remote").asString());
45 yError()<<
"PassThroughInertial: failed to open the proxy device";
55 yError()<<
"PassThroughInertial: the view of one interface failed";
61 yInfo(
"Finish PassThroughInertial::open");
78 return proxyIGyro->getNrOfThreeAxisGyroscopes();
85 return yarp::dev::MAS_ERROR;
86 return proxyIGyro->getThreeAxisGyroscopeStatus(sens_index);
93 return proxyIGyro->getThreeAxisGyroscopeName(sens_index, name);
100 return proxyIGyro->getThreeAxisGyroscopeFrameName(sens_index, frameName);
107 return proxyIGyro->getThreeAxisGyroscopeMeasure(sens_index,
out, timestamp);
115 return proxyIAccel->getNrOfThreeAxisLinearAccelerometers();
122 return yarp::dev::MAS_ERROR;
123 return proxyIAccel->getThreeAxisLinearAccelerometerStatus(sens_index);
130 return proxyIAccel->getThreeAxisLinearAccelerometerName(sens_index, name);
137 return proxyIAccel->getThreeAxisLinearAccelerometerFrameName(sens_index, frameName);
144 return proxyIAccel->getThreeAxisLinearAccelerometerMeasure(sens_index,
out, timestamp);
158 return yarp::dev::MAS_ERROR;
159 return proxyIOrient->getOrientationSensorStatus(sens_index);
166 return proxyIOrient->getOrientationSensorName(sens_index, name);
173 return proxyIOrient->getOrientationSensorFrameName(sens_index, frameName);
180 return proxyIOrient->getOrientationSensorMeasureAsRollPitchYaw(sens_index, rpy, timestamp);
187 return proxyIMagn->getNrOfThreeAxisMagnetometers();
193 return yarp::dev::MAS_ERROR;
194 return proxyIMagn->getThreeAxisMagnetometerStatus(sens_index);
201 return proxyIMagn->getThreeAxisMagnetometerName(sens_index, name);
208 return proxyIMagn->getThreeAxisMagnetometerFrameName(sens_index, frameName);
215 return proxyIMagn->getThreeAxisMagnetometerMeasure(sens_index,
out, timestamp);
222 yError()<<
"PassThroughInertial: holding a subdevice, attach not allowed";
228 yError(
"PassThroughInertial: this device only supports exposing a "
229 "single PassThroughInertial device on YARP ports, but %d devices have been passed in attachAll.",
p.size());
230 yError(
"PassThroughInertial: please use the multipleanalogsensorsremapper device to combine several device in a new device.");
237 yError(
"PassThroughInertial: no device passed to attachAll, please pass a device to expose on YARP ports.");
241 yarp::dev::PolyDriver* poly =
p[0]->poly;
245 yError(
"PassThroughInertial: null pointer passed to attachAll.");
262 yInfo()<<
"PassThroughInertial: attach finished with success";
bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
size_t getNrOfThreeAxisMagnetometers() const override
bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override
size_t getNrOfOrientationSensors() const override
bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double ×tamp) const override
bool attachAll(const yarp::dev::PolyDriverList &p) override
bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override
size_t getNrOfThreeAxisGyroscopes() const override
bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector &rpy, double ×tamp) const override
yarp::dev::IThreeAxisGyroscopes * proxyIGyro
bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override
yarp::dev::IThreeAxisLinearAccelerometers * proxyIAccel
bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double ×tamp) const override
bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override
yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override
bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override
yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override
yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override
yarp::dev::IThreeAxisMagnetometers * proxyIMagn
bool open(yarp::os::Searchable &config) override
yarp::dev::IOrientationSensors * proxyIOrient
bool detachAll() override
size_t getNrOfThreeAxisLinearAccelerometers() const override
bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override
yarp::dev::PolyDriver proxyDevice
virtual ~PassThroughInertial()
yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override
bool getOrientationSensorName(size_t sens_index, std::string &name) const override
bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double ×tamp) const override
Copyright (C) 2008 RobotCub Consortium.