YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::dev::IOrientationSensors Class Referenceabstract

Device interface to one or multiple orientation sensors, such as IMUs with on board estimation algorithms. More...

#include <yarp/dev/MultipleAnalogSensorsInterfaces.h>

+ Inheritance diagram for yarp::dev::IOrientationSensors:

Public Member Functions

virtual size_t getNrOfOrientationSensors () const =0
 Get the number of orientation sensors exposed by this device.
 
virtual yarp::dev::MAS_status getOrientationSensorStatus (size_t sens_index) const =0
 Get the status of the specified sensor.
 
virtual bool getOrientationSensorName (size_t sens_index, std::string &name) const =0
 Get the name of the specified sensor.
 
virtual bool getOrientationSensorFrameName (size_t sens_index, std::string &frameName) const =0
 Get the name of the frame of the specified sensor.
 
virtual bool getOrientationSensorMeasureAsRollPitchYaw (size_t sens_index, yarp::sig::Vector &rpy, double &timestamp) const =0
 Get the last reading of the orientation sensor as roll pitch yaw.
 
virtual ~IOrientationSensors ()
 

Detailed Description

Device interface to one or multiple orientation sensors, such as IMUs with on board estimation algorithms.

The device returns the relative orientation between a lab or surface-fixed frame and a frame rigidly attached to the sensor.

The definition of the lab or surface-fixed frame is sensor-specific.

Sensor Tag
OrientationSensors

Definition at line 350 of file MultipleAnalogSensorsInterfaces.h.

Constructor & Destructor Documentation

◆ ~IOrientationSensors()

virtual yarp::dev::IOrientationSensors::~IOrientationSensors ( )
inlinevirtual

Definition at line 428 of file MultipleAnalogSensorsInterfaces.h.

Member Function Documentation

◆ getNrOfOrientationSensors()

virtual size_t yarp::dev::IOrientationSensors::getNrOfOrientationSensors ( ) const
pure virtual

Get the number of orientation sensors exposed by this device.

Implemented in realsense2Tracking, realsense2withIMUDriver, Imu_nwc_ros2, FakeIMU, FakePositionSensor, BoschIMU, MultipleAnalogSensorsRemapper, and MultipleAnalogSensorsClient.

◆ getOrientationSensorFrameName()

virtual bool yarp::dev::IOrientationSensors::getOrientationSensorFrameName ( size_t  sens_index,
std::string &  frameName 
) const
pure virtual

Get the name of the frame of the specified sensor.

Note
This is an implementation specific method, that may return the name of the sensor frame in a scenegraph
Returns
false if an error occurred, true otherwise.

Implemented in realsense2Tracking, realsense2withIMUDriver, Imu_nwc_ros2, FakeIMU, FakePositionSensor, BoschIMU, MultipleAnalogSensorsRemapper, and MultipleAnalogSensorsClient.

◆ getOrientationSensorMeasureAsRollPitchYaw()

virtual bool yarp::dev::IOrientationSensors::getOrientationSensorMeasureAsRollPitchYaw ( size_t  sens_index,
yarp::sig::Vector rpy,
double &  timestamp 
) const
pure virtual

Get the last reading of the orientation sensor as roll pitch yaw.

If $ f $ is the lab or surface fixed frame, and $ s $ is the sensor-fixed frame, this methods returns the angles $ r \in [-180, 180] , p \in [-90, 90], y \in [-180, 180]$ such that

\[
{}^f R_s = RotZ\left(\frac{\pi}{180}y\right)*RotY\left(\frac{\pi}{180}p\right)*RotX\left(\frac{\pi}{180}r\right)
\]

with

\[
RotZ(\theta)
 =
 \begin{bmatrix}
     \cos(\theta)      & -\sin(\theta) & 0              \\
     \sin(\theta)      & \cos(\theta)  & 0              \\
     0                 & 0             & 1              \\
 \end{bmatrix}
\]

,

\[
RotY(\theta)
=
 \begin{bmatrix}
     \cos(\theta)      & 0             & \sin(\theta)   \\
     0                 & 1             & 0              \\
     -\sin(\theta)     & 0             & \cos(\theta)   \\
 \end{bmatrix}
\]

and

\[
RotX(\theta)
=
 \begin{bmatrix}
     1 & 0             & 0              \\
     0 & \cos(\theta)  & - \sin(\theta) \\
     0 & \sin(\theta)  & \cos(\theta)   \\
 \end{bmatrix}
\]

where $ {}^f R_s \in \mathbb{R}^{3 \times 3} $ is the rotation that left-multiplied by a 3d column vector expressed in $ s $ it returns it expressed in $ f $ .

Parameters
[in]sens_indexThe index of the specified sensor (should be between 0 and getNrOfOrientationSensors()-1).
[out]outThe requested measure. The vector should be 3-dimensional. The measure is expressed in degrees .
[out]timestampThe timestamp of the requested measure, expressed in seconds.
Returns
false if an error occurred, true otherwise.

Implemented in realsense2Tracking, realsense2withIMUDriver, Imu_nwc_ros2, FakeIMU, BoschIMU, MultipleAnalogSensorsRemapper, MultipleAnalogSensorsClient, and FakePositionSensor.

◆ getOrientationSensorName()

virtual bool yarp::dev::IOrientationSensors::getOrientationSensorName ( size_t  sens_index,
std::string &  name 
) const
pure virtual

Get the name of the specified sensor.

Returns
false if an error occurred, true otherwise.

Implemented in realsense2Tracking, realsense2withIMUDriver, Imu_nwc_ros2, FakeIMU, FakePositionSensor, BoschIMU, MultipleAnalogSensorsRemapper, and MultipleAnalogSensorsClient.

◆ getOrientationSensorStatus()

virtual yarp::dev::MAS_status yarp::dev::IOrientationSensors::getOrientationSensorStatus ( size_t  sens_index) const
pure virtual

The documentation for this class was generated from the following file: