mirror of https://github.com/ArduPilot/ardupilot
AP_NavEKF2: remove un-wanted functionality from mag and yaw reset
The function used to reset magnetic field states and yaw angle should not be used when there is no magnetometer. If it is incorrectly called without a magnetometer it should not change the attitude or field states.
This commit is contained in:
parent
11c6ea7ef6
commit
830751c0ae
|
@ -1291,7 +1291,6 @@ void NavEKF2_core::calcEarthRateNED(Vector3f &omega, int32_t latitude) const
|
|||
|
||||
// initialise the earth magnetic field states using declination, suppled roll/pitch
|
||||
// and magnetometer measurements and return initial attitude quaternion
|
||||
// if no magnetometer data, do not update magnetic field states and assume zero yaw angle
|
||||
Quaternion NavEKF2_core::calcQuatAndFieldStates(float roll, float pitch)
|
||||
{
|
||||
// declare local variables required to calculate initial orientation and magnetic field
|
||||
|
@ -1362,8 +1361,8 @@ Quaternion NavEKF2_core::calcQuatAndFieldStates(float roll, float pitch)
|
|||
// clear bad magnetic yaw status
|
||||
badMagYaw = false;
|
||||
} else {
|
||||
initQuat.from_euler(roll, pitch, 0.0f);
|
||||
yawAlignComplete = false;
|
||||
// no magnetoemter data so there is nothing we can do
|
||||
initQuat = stateStruct.quat;
|
||||
}
|
||||
|
||||
// return attitude quaternion
|
||||
|
|
Loading…
Reference in New Issue