mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 15:03:34 +08:00
ekf2: simplify fuseYaw() signature and use consistently
- make it safe to call for other aid sources, no EKF state is changed unless fusion_enabled
This commit is contained in:
@@ -524,9 +524,12 @@ void Ekf::runMagAndMagDeclFusions(const Vector3f &mag)
|
||||
float innovation = wrap_pi(getEulerYaw(_R_to_earth) - measured_hdg);
|
||||
float obs_var = fmaxf(sq(_params.mag_heading_noise), 1.e-4f);
|
||||
|
||||
_aid_src_mag_heading.observation = measured_hdg;
|
||||
_aid_src_mag_heading.observation_variance = obs_var;
|
||||
_aid_src_mag_heading.innovation = innovation;
|
||||
_aid_src_mag_heading.fusion_enabled = _control_status.flags.mag_hdg;
|
||||
|
||||
fuseYaw(innovation, obs_var, _aid_src_mag_heading);
|
||||
fuseYaw(_aid_src_mag_heading);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user