Skip to content

Commit

Permalink
AP_NavEKF: ExtNav yaw aligned when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Jul 5, 2024
1 parent fb44135 commit 0af744c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libraries/AP_NavEKF/AP_NavEKF_Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,20 @@ void AP_NavEKF_Source::align_inactive_sources()
}
}
visual_odom->align_position_to_ahrs(align_posxy, align_posz);

// consider aligning yaw:
if ((getYawSource() == SourceYaw::COMPASS) ||
(getYawSource() == SourceYaw::GPS) ||
(getYawSource() == SourceYaw::GPS_COMPASS_FALLBACK) ||
(getYawSource() == SourceYaw::GSF)) {
for (uint8_t i=0; i<AP_NAKEKF_SOURCE_SET_MAX; i++) {
if (_source_set[i].yaw == SourceYaw::EXTNAV) {
// ExtNav could potentially be used, so align it
visual_odom->request_align_yaw_to_ahrs();
break;
}
}
}
#endif
}

Expand Down

0 comments on commit 0af744c

Please sign in to comment.