mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 00:21:35 +08:00
gyro_calibration: reset on any parameter change
- perform fresh calibration once system has settled
This commit is contained in:
@@ -84,6 +84,7 @@ void GyroCalibration::Run()
|
|||||||
|
|
||||||
_armed = armed;
|
_armed = armed;
|
||||||
Reset();
|
Reset();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,14 +99,16 @@ void GyroCalibration::Run()
|
|||||||
|
|
||||||
if (_vehicle_status_flags_sub.copy(&vehicle_status_flags)) {
|
if (_vehicle_status_flags_sub.copy(&vehicle_status_flags)) {
|
||||||
if (_system_calibrating != vehicle_status_flags.condition_calibration_enabled) {
|
if (_system_calibrating != vehicle_status_flags.condition_calibration_enabled) {
|
||||||
Reset();
|
|
||||||
_system_calibrating = vehicle_status_flags.condition_calibration_enabled;
|
_system_calibrating = vehicle_status_flags.condition_calibration_enabled;
|
||||||
|
Reset();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_system_calibrating) {
|
if (_system_calibrating) {
|
||||||
// do nothing if system is calibrating
|
// do nothing if system is calibrating
|
||||||
|
Reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +126,9 @@ void GyroCalibration::Run()
|
|||||||
for (auto &cal : _gyro_calibration) {
|
for (auto &cal : _gyro_calibration) {
|
||||||
cal.ParametersUpdate();
|
cal.ParametersUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reset();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user