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/IMultipleWrapper.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
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 &timestamp) 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 &timestamp) 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 &timestamp) 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
size_t getNrOfThreeAxisLinearAccelerometers() const override
bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override
yarp::dev::PolyDriver proxyDevice
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 &timestamp) const override
Copyright (C) 2008 RobotCub Consortium.
out
Definition: sine.m:8