mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 03:43:33 +08:00
temperature_calibration: make sure to report an error only once
This commit is contained in:
@@ -127,6 +127,7 @@ void TemperatureCalibration::task_main()
|
|||||||
|
|
||||||
//init calibrators
|
//init calibrators
|
||||||
TemperatureCalibrationBase *calibrators[3];
|
TemperatureCalibrationBase *calibrators[3];
|
||||||
|
bool error_reported[3] = {};
|
||||||
int num_calibrators = 0;
|
int num_calibrators = 0;
|
||||||
|
|
||||||
if (_accel) {
|
if (_accel) {
|
||||||
@@ -200,7 +201,10 @@ void TemperatureCalibration::task_main()
|
|||||||
ret = calibrators[i]->update();
|
ret = calibrators[i]->update();
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
PX4_ERR("Calibration update step failed (%i)", ret);
|
if (!error_reported[i]) {
|
||||||
|
PX4_ERR("Calibration update step failed (%i)", ret);
|
||||||
|
error_reported[i] = true;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (ret < min_progress) {
|
} else if (ret < min_progress) {
|
||||||
min_progress = ret;
|
min_progress = ret;
|
||||||
@@ -220,6 +224,8 @@ void TemperatureCalibration::task_main()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PX4_INFO("Sensor Measurments completed");
|
||||||
|
|
||||||
// do final calculations & parameter storage
|
// do final calculations & parameter storage
|
||||||
for (int i = 0; i < num_calibrators; ++i) {
|
for (int i = 0; i < num_calibrators; ++i) {
|
||||||
int ret = calibrators[i]->finish();
|
int ret = calibrators[i]->finish();
|
||||||
|
|||||||
Reference in New Issue
Block a user