iCub-main
PassThroughInertial.h
Go to the documentation of this file.
1 #ifndef PASS_THROUGH_INERTIAL_H
2 #define PASS_THROUGH_INERTIAL_H
3 
4 #include <yarp/dev/DeviceDriver.h>
5 #include <yarp/dev/MultipleAnalogSensorsInterfaces.h>
6 #include <yarp/dev/Wrapper.h>
7 #include <yarp/dev/PolyDriver.h>
8 
9 
10 namespace yarp {
11  namespace dev {
12  class PassThroughInertial;
13  }
14 }
15 
16 class yarp::dev::PassThroughInertial : public DeviceDriver,
17  public yarp::dev::IThreeAxisGyroscopes,
18  public yarp::dev::IThreeAxisLinearAccelerometers,
19  public yarp::dev::IThreeAxisMagnetometers,
20  public yarp::dev::IOrientationSensors,
21  public yarp::dev::IMultipleWrapper
22 {
23  bool ownSubdevice {false};
24 protected:
25  yarp::dev::PolyDriver proxyDevice;
26  yarp::dev::IThreeAxisGyroscopes * proxyIGyro;
27  yarp::dev::IThreeAxisLinearAccelerometers * proxyIAccel;
28  yarp::dev::IThreeAxisMagnetometers * proxyIMagn;
29  yarp::dev::IOrientationSensors * proxyIOrient;
30 
31 public:
32  //CONSTRUCTOR
34  virtual ~PassThroughInertial();
35 
36  //DEVICE DRIVER
37  bool open(yarp::os::Searchable& config) override;
38  bool close() override;
39 
40  /* IThreeAxisGyroscopes methods */
41  size_t getNrOfThreeAxisGyroscopes() const override;
42  yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override;
43  bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override;
44  bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override;
45  bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
46 
47  /* IThreeAxisLinearAccelerometers methods */
48  size_t getNrOfThreeAxisLinearAccelerometers() const override;
49  yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override;
50  bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override;
51  bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override;
52  bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
53 
54  /* IThreeAxisMagnetometers methods */
55  size_t getNrOfThreeAxisMagnetometers() const override;
56  yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override;
57  bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override;
58  bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override;
59  bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
60 
61  /* IOrientationSensors methods */
62  size_t getNrOfOrientationSensors() const override;
63  yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override;
64  bool getOrientationSensorName(size_t sens_index, std::string &name) const override;
65  bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override;
66  bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector& rpy, double& timestamp) const override;
67 
68  /* IMultipleWrapper methods */
69  bool attachAll(const yarp::dev::PolyDriverList &p) override;
70  bool detachAll() override;
71 };
72 #endif // PASS_THROUGH_INERTIAL_H
yarp::dev::PassThroughInertial::getThreeAxisGyroscopeStatus
yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override
Definition: PassThroughInertial.cpp:82
yarp::dev::PassThroughInertial::close
bool close() override
Definition: PassThroughInertial.cpp:65
yarp::dev::PassThroughInertial::getNrOfThreeAxisLinearAccelerometers
size_t getNrOfThreeAxisLinearAccelerometers() const override
Definition: PassThroughInertial.cpp:111
yarp::dev::PassThroughInertial::getThreeAxisLinearAccelerometerFrameName
bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
Definition: PassThroughInertial.cpp:133
yarp::dev::PassThroughInertial::getThreeAxisGyroscopeMeasure
bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Definition: PassThroughInertial.cpp:103
yarp::dev::PassThroughInertial::getThreeAxisGyroscopeFrameName
bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override
Definition: PassThroughInertial.cpp:96
yarp::dev::PassThroughInertial::proxyIOrient
yarp::dev::IOrientationSensors * proxyIOrient
Definition: PassThroughInertial.h:29
yarp::dev::PassThroughInertial::proxyIGyro
yarp::dev::IThreeAxisGyroscopes * proxyIGyro
Definition: PassThroughInertial.h:26
yarp::dev::PassThroughInertial::getThreeAxisLinearAccelerometerStatus
yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override
Definition: PassThroughInertial.cpp:119
yarp::dev::PassThroughInertial::getThreeAxisMagnetometerFrameName
bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override
Definition: PassThroughInertial.cpp:204
out
out
Definition: sine.m:8
yarp::dev::PassThroughInertial::proxyIMagn
yarp::dev::IThreeAxisMagnetometers * proxyIMagn
Definition: PassThroughInertial.h:28
yarp::dev::PassThroughInertial::getNrOfOrientationSensors
size_t getNrOfOrientationSensors() const override
Definition: PassThroughInertial.cpp:148
yarp::dev::PassThroughInertial::getThreeAxisMagnetometerStatus
yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override
Definition: PassThroughInertial.cpp:190
yarp::dev::PassThroughInertial::getNrOfThreeAxisMagnetometers
size_t getNrOfThreeAxisMagnetometers() const override
Definition: PassThroughInertial.cpp:183
p
p
Definition: show_eyes_axes.m:23
yarp::dev::PassThroughInertial::getOrientationSensorStatus
yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override
Definition: PassThroughInertial.cpp:155
yarp::dev::PassThroughInertial::getThreeAxisLinearAccelerometerMeasure
bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Definition: PassThroughInertial.cpp:140
yarp::dev::PassThroughInertial::getNrOfThreeAxisGyroscopes
size_t getNrOfThreeAxisGyroscopes() const override
Definition: PassThroughInertial.cpp:74
yarp::dev::PassThroughInertial::getOrientationSensorName
bool getOrientationSensorName(size_t sens_index, std::string &name) const override
Definition: PassThroughInertial.cpp:162
yarp::dev::PassThroughInertial::detachAll
bool detachAll() override
Definition: PassThroughInertial.cpp:268
string
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}") include_directories($
Definition: CMakeLists.txt:9
yarp::dev::PassThroughInertial::getThreeAxisGyroscopeName
bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override
Definition: PassThroughInertial.cpp:89
yarp::dev::PassThroughInertial::proxyIAccel
yarp::dev::IThreeAxisLinearAccelerometers * proxyIAccel
Definition: PassThroughInertial.h:27
yarp::dev::PassThroughInertial::attachAll
bool attachAll(const yarp::dev::PolyDriverList &p) override
Definition: PassThroughInertial.cpp:218
yarp::dev::PassThroughInertial
Definition: PassThroughInertial.h:16
yarp::dev::PassThroughInertial::PassThroughInertial
PassThroughInertial()
Definition: PassThroughInertial.cpp:8
yarp::dev::PassThroughInertial::~PassThroughInertial
virtual ~PassThroughInertial()
Definition: PassThroughInertial.cpp:15
yarp::dev::PassThroughInertial::getThreeAxisLinearAccelerometerName
bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override
Definition: PassThroughInertial.cpp:126
yarp
Copyright (C) 2008 RobotCub Consortium.
Definition: DebugInterfaces.h:51
yarp::dev::PassThroughInertial::proxyDevice
yarp::dev::PolyDriver proxyDevice
Definition: PassThroughInertial.h:25
yarp::dev::PassThroughInertial::getThreeAxisMagnetometerName
bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override
Definition: PassThroughInertial.cpp:197
yarp::dev::PassThroughInertial::getOrientationSensorMeasureAsRollPitchYaw
bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector &rpy, double &timestamp) const override
Definition: PassThroughInertial.cpp:176
yarp::dev::PassThroughInertial::getThreeAxisMagnetometerMeasure
bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
Definition: PassThroughInertial.cpp:211
yarp::dev::PassThroughInertial::getOrientationSensorFrameName
bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override
Definition: PassThroughInertial.cpp:169
yarp::dev::PassThroughInertial::open
bool open(yarp::os::Searchable &config) override
Definition: PassThroughInertial.cpp:20