sensor_event_get_apr()

Get the azimuth, pitch, and roll data values from a sensor event.

Synopsis:

#include <bps/sensor.h>
 
BPS_API int sensor_event_get_apr(bps_event_t *event, float *azimuth, float *pitch, float *roll)

Arguments:

event
The sensor event to get the azimuth, pitch, and roll data values from.
azimuth
The device's azimuth value (in degrees). This value is between 0 and 359.
pitch
The device's pitch value (in degrees). This value is between -180 and 180.
roll
The device's roll value (in degrees). This value is between -90 and 90.

Library:

libbps

Description:

The sensor_event_get_apr() function gets the azimuth, pitch, and roll data values from the specified sensor event. The sensor event that you pass to this function must be SENSOR_AZIMUTH_PITCH_ROLL_READING.

Azimuth refers to the angle between magnetic north (not true north) and the y-axis, around the z-axis. If you require the azimuth relative to true north, you must apply magnetic declination manually. Pitch refers to the rotation around the x-axis, with positive values indicating that the z-axis is moving towards the y-axis. Roll refers to the rotation around the y-axis, with positive values indicating that the x-axis is moving toward the z-axis.

Returns:

BPS_SUCCESS upon success, BPS_FAILURE with errno set otherwise.