You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidAccelerometer::recalculatePitchRoll()
{
double x = (double) sample.x;
double y = (double) sample.y;
double z = (double) sample.z;
roll = atan2(x, -z);
pitch = atan2(y, (x*sin(roll) - z*cos(roll)));
// Handle to the two "negative quadrants", such that we get an output in the +/- 18- degree range.// This ensures that the pitch values are consistent with the roll values.if (z > 0.0)
{
double reference = pitch > 0.0 ? (PI / 2.0) : (-PI / 2.0);
pitch = reference + (reference - pitch);
}
status |= ACCELEROMETER_IMU_DATA_VALID;
}
In codal-core
Accelerometer::recalculatePitchRoll()
:And
Compass::getFieldStrength()
:@finneyj we probably don't need the extra precision and can downgrade them to floats?
The text was updated successfully, but these errors were encountered: