iCub-main
Loading...
Searching...
No Matches
embObjIMU.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3 * All rights reserved.
4 * Author: Valentina Gaggero
5 * This software may be modified and distributed under the terms of the
6 * BSD-3-Clause license. See the accompanying LICENSE file for details.
7 */
8
9
10#ifndef __embObjIMU_h__
11#define __embObjIMU_h__
12
13#include <string>
14#include <yarp/dev/DeviceDriver.h>
15
16#include <yarp/dev/MultipleAnalogSensorsInterfaces.h>
17
18#include "IethResource.h"
19
20
21
38namespace yarp {
39 namespace dev {
40 class embObjIMU;
41 }
42}
43
44class yarp::dev::embObjIMU : public DeviceDriver,
45 public yarp::dev::IThreeAxisGyroscopes,
46 public yarp::dev::IThreeAxisLinearAccelerometers,
47 public yarp::dev::IThreeAxisMagnetometers,
48 public yarp::dev::IOrientationSensors,
50{
51
52public:
53 embObjIMU();
54 ~embObjIMU();
55
56 // Device Driver interface
57 virtual bool open(yarp::os::Searchable &config) override;
58 virtual bool close() override;
59
60 /* IThreeAxisGyroscopes methods */
61 virtual size_t getNrOfThreeAxisGyroscopes() const override;
62 virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override;
63 virtual bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override;
64 virtual bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override;
65 virtual bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
66
67 /* IThreeAxisLinearAccelerometers methods */
68 virtual size_t getNrOfThreeAxisLinearAccelerometers() const override;
69 virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override;
70 virtual bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override;
71 virtual bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override;
72 virtual bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
73
74 /* IThreeAxisMagnetometers methods */
75 virtual size_t getNrOfThreeAxisMagnetometers() const override;
76 virtual yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override;
77 virtual bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override;
78 virtual bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override;
79 virtual bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
80
81 /* IOrientationSensors methods */
82 virtual size_t getNrOfOrientationSensors() const override;
83 virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override;
84 virtual bool getOrientationSensorName(size_t sens_index, std::string &name) const override;
85 virtual bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override;
86 virtual bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector& rpy, double& timestamp) const override;
87
88
89 /* Iethresource methods */
90 virtual bool initialised();
91 virtual eth::iethresType_t type();
92 virtual bool update(eOprotID32_t id32, double timestamp, void* rxdata);
93
94
95private:
96
97 void *mPriv;
98
99 std::string getBoardInfo(void) const;
100 std::pair <size_t, eOas_sensor_t> getGyroSubIndex(size_t sens_index) const;
101 std::pair <size_t, eOas_sensor_t> getAccSubIndex(size_t sens_index) const;
102 void cleanup(void);
103
104 //debug
105 void updateDebugPrints(eOprotID32_t id32, double timestamp, void* rxdata);
106
107};
108
109#endif //__embObjIMU_h__
110
virtual yarp::dev::MAS_status getThreeAxisGyroscopeStatus(size_t sens_index) const override
virtual bool getOrientationSensorFrameName(size_t sens_index, std::string &frameName) const override
virtual size_t getNrOfThreeAxisMagnetometers() const override
virtual bool getOrientationSensorName(size_t sens_index, std::string &name) const override
virtual bool getThreeAxisLinearAccelerometerName(size_t sens_index, std::string &name) const override
embObjIMU()
This device implements the embObjIMU sensor.
Definition embObjIMU.cpp:45
virtual yarp::dev::MAS_status getThreeAxisLinearAccelerometerStatus(size_t sens_index) const override
virtual eth::iethresType_t type()
virtual bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector &rpy, double &timestamp) const override
virtual bool close() override
virtual bool initialised()
virtual bool update(eOprotID32_t id32, double timestamp, void *rxdata)
virtual yarp::dev::MAS_status getOrientationSensorStatus(size_t sens_index) const override
virtual yarp::dev::MAS_status getThreeAxisMagnetometerStatus(size_t sens_index) const override
virtual size_t getNrOfThreeAxisGyroscopes() const override
virtual bool getThreeAxisGyroscopeFrameName(size_t sens_index, std::string &frameName) const override
virtual size_t getNrOfOrientationSensors() const override
virtual bool getThreeAxisGyroscopeMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
virtual bool open(yarp::os::Searchable &config) override
virtual bool getThreeAxisGyroscopeName(size_t sens_index, std::string &name) const override
virtual bool getThreeAxisMagnetometerName(size_t sens_index, std::string &name) const override
virtual bool getThreeAxisLinearAccelerometerFrameName(size_t sens_index, std::string &frameName) const override
virtual size_t getNrOfThreeAxisLinearAccelerometers() const override
virtual bool getThreeAxisMagnetometerFrameName(size_t sens_index, std::string &frameName) const override
virtual bool getThreeAxisLinearAccelerometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
virtual bool getThreeAxisMagnetometerMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
iethresType_t
Copyright (C) 2008 RobotCub Consortium.
out
Definition sine.m:8