Skip to content

Commit

Permalink
gyro sensors/debug: record standard deviation for roll *only*
Browse files Browse the repository at this point in the history
* visibile in the DEBUG_GYRO_RAW[3]
  • Loading branch information
fujin committed Jun 9, 2018
1 parent f8ebdf0 commit 03b480a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/sensors/gyro.c
Expand Up @@ -864,8 +864,11 @@ STATIC_UNIT_TESTED void performGyroCalibration(gyroSensor_t *gyroSensor, uint8_t

if (isOnFinalGyroCalibrationCycle(&gyroSensor->calibration)) {
const float stddev = devStandardDeviation(&gyroSensor->calibration.var[axis]);
// DEBUG_GYRO_CALIBRATION records per-axis standard deviation
DEBUG_SET(DEBUG_GYRO_CALIBRATION, axis, lrintf(stddev));
// DEBUG_GYRO_CALIBRATION records the standard deviation of roll
// into the spare field - debug[3], in DEBUG_GYRO_RAW
if (axis == X) {
DEBUG_SET(DEBUG_GYRO_RAW, DEBUG_GYRO_CALIBRATION, lrintf(stddev));
}

// check deviation and startover in case the model was moved
if (gyroMovementCalibrationThreshold && stddev > gyroMovementCalibrationThreshold) {
Expand Down

0 comments on commit 03b480a

Please sign in to comment.