Skip to content

Commit

Permalink
AP_Airspeed: Tag a uninit airspeed sensor as a failure when calibrating
Browse files Browse the repository at this point in the history
This helps catch the case where a GCS commands a calibration, and the
command is reported as MAV_RESULT_ACCEPTED, even though the actual state
is that at least one sensor backend failed. We are still letting the
other sensors be calibrated in this situation as a GCS may not be paying
proper attention to what happens with the MAV_RESULT and a user could
miss the status text, so it's safer to calibrate everything we can, and
then report a failure afterwards.
  • Loading branch information
WickedShell committed Oct 25, 2024
1 parent 2524583 commit 32a87ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/AP_Airspeed/AP_Airspeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ void AP_Airspeed::calibrate(bool in_startup)
continue;
}
if (sensor[i] == nullptr) {
GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "Airspeed %u not initalized, cannot cal", i+1);
GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "Airspeed %u not initialized, cannot calibrate", i+1);
calibration_state[i] = CalibrationState::FAILED;
continue;
}
state[i].cal.start_ms = AP_HAL::millis();
Expand Down

0 comments on commit 32a87ce

Please sign in to comment.