Ejemplo n.º 1
0
/**
 *  @brief      Angular velocity (degrees per second) in body frame.
 *  @param[out] data        Angular velocity in dps, q16 fixed point.
 *  @param[out] accuracy    Accuracy of the measurement from 0 (least accurate)
 *                          to 3 (most accurate).
 *  @param[out] timestamp   The time in milliseconds when this sensor was read.
 *  @return     1 if data was updated. 
 */
int inv_get_sensor_type_gyro(long *data, int8_t *accuracy, inv_time_t *timestamp)
{
    inv_get_gyro_set(data, accuracy, timestamp);
    if (eMPL_out.gyro_status & INV_NEW_DATA)
        return 1;
    else
        return 0;
}
Ejemplo n.º 2
0
/**
 *  Angular velocity (degrees per second) in body frame.
 *  @param[out] values      Angular velocity in dps.
 *  @param[out] accuracy    0 (uncalibrated) to 3 (most accurate).
 *  @param[out] timestamp   Time when sensor was sampled.
 */
void inv_get_sensor_type_gyro_float(float *values, int8_t *accuracy,
        inv_time_t *timestamp)
{
    long gyro[3];
    inv_get_gyro_set(gyro, accuracy, timestamp);

    values[0] = (float)gyro[0] / 65536.f;
    values[1] = (float)gyro[1] / 65536.f;
    values[2] = (float)gyro[2] / 65536.f;
}