sensor_event_get_apr()

Retrieve 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)

Since:

BlackBerry 10.0.0

Arguments:

event

The sensor event to get the azimuth, pitch, and roll data values from.

azimuth

The device's azimuth value (in degrees). Valid values can range from 0 to 359 degrees.

pitch

The device's pitch value (in degrees). Valid values can range from -180 to 180 degrees.

roll

The device's roll value (in degrees). Valid values can range from -90 and 90 degrees.

Library:

libbps (For the qcc command, use the -l bps option to link against this library)

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. Positive values indicate that the z-axis is moving towards the y-axis. Roll refers to the rotation around the y-axis. Positive values indicate that the x-axis is moving toward the z-axis.

Returns:

BPS_SUCCESS when the function completes successfully, BPS_FAILURE with errno value set otherwise.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus