mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 01:17:51 +08:00
gyro_calibration: add additional validity check before finalizing calibrations
- this can slip through if sensors are running normally, but then stop publishing valid data
This commit is contained in:
@@ -232,7 +232,7 @@ void GyroCalibration::Run()
|
||||
bool calibration_updated = false;
|
||||
|
||||
for (int gyro = 0; gyro < _sensor_gyro_subs.size(); gyro++) {
|
||||
if (_gyro_calibration[gyro].device_id() != 0) {
|
||||
if (_gyro_calibration[gyro].device_id() != 0 && _gyro_mean[gyro].valid()) {
|
||||
|
||||
// check variance again before saving
|
||||
if (_gyro_mean[gyro].variance().longerThan(0.001f)) {
|
||||
|
||||
Reference in New Issue
Block a user