AP_NavEKF3: do not log DefaultAirspeed if logging not started

if we are not going to use this value ourselves then we certainly should not add it to the replay log
This commit is contained in:
Peter Barker 2024-08-21 09:56:15 +10:00 committed by Andrew Tridgell
parent 00dc15063e
commit 4e27c51aa1

View File

@ -2043,12 +2043,15 @@ void NavEKF3::updateLaneSwitchPosDownResetData(uint8_t new_primary, uint8_t old_
// Writes the default equivalent airspeed and 1-sigma uncertainty in m/s to be used in forward flight if a measured airspeed is required and not available.
void NavEKF3::writeDefaultAirSpeed(float airspeed, float uncertainty)
{
// ignore any data if the EKF is not started
if (!core) {
return;
}
AP::dal().log_writeDefaultAirSpeed3(airspeed, uncertainty);
if (core) {
for (uint8_t i=0; i<num_cores; i++) {
core[i].writeDefaultAirSpeed(airspeed, uncertainty);
}
for (uint8_t i=0; i<num_cores; i++) {
core[i].writeDefaultAirSpeed(airspeed, uncertainty);
}
}