mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-14 23:47:34 +08:00
EKF: Allow EKF to start without using mag data when not using earth frame data
This commit is contained in:
committed by
Paul Riseborough
parent
572710ed27
commit
c49ab760c7
@@ -595,6 +595,10 @@ bool Ekf::resetMagHeading(Vector3f &mag_init)
|
||||
// the angle of the projection onto the horizontal gives the yaw angle
|
||||
euler321(2) = -atan2f(mag_earth_pred(1), mag_earth_pred(0)) + _mag_declination;
|
||||
|
||||
} else if (_params.mag_fusion_type == MAG_FUSE_TYPE_INDOOR && _mag_use_inhibit) {
|
||||
// we are operating without knowing the earth frame yaw angle
|
||||
return true;
|
||||
|
||||
} else {
|
||||
// there is no yaw observation
|
||||
return false;
|
||||
@@ -649,6 +653,10 @@ bool Ekf::resetMagHeading(Vector3f &mag_init)
|
||||
// the angle of the projection onto the horizontal gives the yaw angle
|
||||
euler312(0) = -atan2f(mag_earth_pred(1), mag_earth_pred(0)) + _mag_declination;
|
||||
|
||||
} else if (_params.mag_fusion_type == MAG_FUSE_TYPE_INDOOR && _mag_use_inhibit) {
|
||||
// we are operating without knowing the earth frame yaw angle
|
||||
return true;
|
||||
|
||||
} else {
|
||||
// there is no yaw observation
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user