AP_NavEKF3: ignore VelZ of body odometry if SRCn_VELZ is set to None

This commit is contained in:
Willian Galvani 2024-11-07 14:06:53 -03:00
parent 4df758f52a
commit 1f11c6add6
1 changed files with 4 additions and 1 deletions

View File

@ -2031,7 +2031,10 @@ void NavEKF3_core::SelectBodyOdomFusion()
// Check for body odometry data (aka visual position delta) at the fusion time horizon
const bool bodyOdomDataToFuse = storedBodyOdm.recall(bodyOdmDataDelayed, imuDataDelayed.time_ms);
if (bodyOdomDataToFuse && frontend->sources.useVelXYSource(AP_NavEKF_Source::SourceXY::EXTNAV)) {
// If VelZ source is set to none, don't use the odometry data for Z velocity
if (!frontend->sources.haveVelZSource()) {
bodyOdmDataDelayed.vel.z = stateStruct.velocity.z;
}
// Fuse data into the main filter
FuseBodyVel();
}