Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

EKF: Fix innovation in fuseDeclination() #590

Merged
merged 3 commits into from
Mar 12, 2019

Conversation

CarlOlsson
Copy link
Contributor

Before we only calculated the _mag_declination variable before mag fusion, leading to the fact that in fuseDeclination() the innovation was not zero (since mag fusion updated the states) even though mag_align_complete was true.

…was not zero in fuseDeclination()

Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
@mhkabir mhkabir requested a review from priseborough March 12, 2019 15:09
@mhkabir mhkabir added the ekf label Mar 12, 2019
EKF/ekf.h Outdated
@@ -553,7 +551,7 @@ class Ekf : public EstimatorInterface
bool realignYawGPS();

// calculate the magnetic declination to be used by the alignment and fusion processing
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this is returning the value, please ensure the header documentation indicates the units, eg radians

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest:

// Returns the magnetic declination in radians to be used by the alignment and fusion processing.

@@ -767,28 +767,28 @@ bool Ekf::resetMagHeading(Vector3f &mag_init, bool increase_yaw_var, bool update
}

// Calculate the magnetic declination to be used by the alignment and fusion processing
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest

// Return the magnetic declination in radians to be used by the alignment and fusion processing.

@priseborough priseborough merged commit fabd216 into PX4:master Mar 12, 2019
dagar pushed a commit to priseborough/PX4-Autopilot that referenced this pull request Mar 13, 2019
Bug Fixes:

PX4/PX4-ECL#586 - EKF: fix covariance and output filter buffer initialization
PX4/PX4-ECL#590 - EKF: Fix innovation in fuseDeclination()

Enhancements:

PX4/PX4-ECL#543 - ekf_helper: add more useful methods to interface with the covariances
PX4/PX4-ECL#588 - Add unit tests for DataValidator

Note:

PX4/PX4-ECL#543  has required a change to how the state variances are accessed .
priseborough added a commit to PX4/PX4-Autopilot that referenced this pull request Mar 14, 2019
Bug Fixes:

PX4/PX4-ECL#586 - EKF: fix covariance and output filter buffer initialization
PX4/PX4-ECL#590 - EKF: Fix innovation in fuseDeclination()

Enhancements:

PX4/PX4-ECL#543 - ekf_helper: add more useful methods to interface with the covariances
PX4/PX4-ECL#588 - Add unit tests for DataValidator

Note:

PX4/PX4-ECL#543  has required a change to how the state variances are accessed .
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants