mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 17:33:37 +08:00
ekf2: add mag type init
In this mode, the mag is used to inilialize the heading. During flight, the heading is predicted using gyros and corrected by GNSS measurements if available.
This commit is contained in:
committed by
Mathieu Bresciani
parent
ca112fea8a
commit
0a665a526c
@@ -130,7 +130,9 @@ void Ekf::controlMagFusion()
|
||||
_innov_check_fail_status.flags.reject_mag_z = (aid_src.test_ratio[2] > 1.f);
|
||||
|
||||
// determine if we should use mag fusion
|
||||
bool continuing_conditions_passing = (_params.mag_fusion_type != MagFuseType::NONE)
|
||||
bool continuing_conditions_passing = ((_params.mag_fusion_type == MagFuseType::INIT)
|
||||
|| (_params.mag_fusion_type == MagFuseType::AUTO)
|
||||
|| (_params.mag_fusion_type == MagFuseType::HEADING))
|
||||
&& _control_status.flags.tilt_align
|
||||
&& (_control_status.flags.yaw_align || (!_control_status.flags.ev_yaw && !_control_status.flags.yaw_align))
|
||||
&& mag_sample.mag.longerThan(0.f)
|
||||
|
||||
@@ -101,7 +101,8 @@ enum MagFuseType : uint8_t {
|
||||
// Integer definitions for mag_fusion_type
|
||||
AUTO = 0, ///< The selection of either heading or 3D magnetometer fusion will be automatic
|
||||
HEADING = 1, ///< Simple yaw angle fusion will always be used. This is less accurate, but less affected by earth field distortions. It should not be used for pitch angles outside the range from -60 to +60 deg
|
||||
NONE = 5 ///< Do not use magnetometer under any circumstance..
|
||||
NONE = 5, ///< Do not use magnetometer under any circumstance.
|
||||
INIT = 6 ///< Use the mag for heading initialization only.
|
||||
};
|
||||
#endif // CONFIG_EKF2_MAGNETOMETER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user