ekf2: improve attitude estimation without horizontal aiding

- fake_pos only if at rest or tilt variances becomes large
 - fake pos: don't run when grav fusion is enabled
 - gravity fusion enabled by default
 - gravity: only fuse when accel norm and lpf norm are consistent

Co-authored-by: bresch <brescianimathieu@gmail.com>
This commit is contained in:
Daniel Agar
2024-01-17 10:27:25 -05:00
co-authored by bresch
parent 8158a14eff
commit ed0d26de8a
9 changed files with 650 additions and 631 deletions
+2 -4
View File
@@ -68,11 +68,9 @@ void Ekf::controlFusionModes(const imuSample &imu_delayed)
// monitor the tilt alignment
if (!_control_status.flags.tilt_align) {
// whilst we are aligning the tilt, monitor the variances
const Vector3f angle_err_var_vec = getQuaternionVariance();
// Once the tilt variances have reduced to equivalent of 3deg uncertainty
// Once the tilt variances have reduced to equivalent of 3 deg uncertainty
// and declare the tilt alignment complete
if ((angle_err_var_vec(0) + angle_err_var_vec(1)) < sq(math::radians(3.0f))) {
if (getTiltVariance() < sq(math::radians(3.f))) {
_control_status.flags.tilt_align = true;
// send alignment status message to the console