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

EKF: Convert GPS yaw observation method to use SymPy generated code#880

Merged
priseborough merged 7 commits into
masterfrom
pr-ekfSymPyGpsYawFusion
Aug 13, 2020
Merged

EKF: Convert GPS yaw observation method to use SymPy generated code#880
priseborough merged 7 commits into
masterfrom
pr-ekfSymPyGpsYawFusion

Conversation

@priseborough

Copy link
Copy Markdown
Collaborator

This PR replaces the Matlab generated equations with sympy generated equations. Continues on from #870.

Modifies the methods used for fusion of GPS receiver yaw angle.
Includes comparison test scripts that compare the observation Jacobians and Kalman gain equations generated for the Matlab symbolic toolbox and SymPy.

Testing

gps_yaw_fusion_generated_compare.cpp output:

Pass: GPS yaw Hfusion max diff fraction = 1.796981e-07
Pass: GPS yaw Kfusion max diff fraction = 3.981467e-07

SITL testing TODO

@priseborough

Copy link
Copy Markdown
Collaborator Author

If someone with a RTK yaw GPs setup can provide a log for replay, then that would be appreciated. TXS.

@priseborough priseborough requested a review from jkflying July 30, 2020 07:52
@bresch

bresch commented Jul 30, 2020

Copy link
Copy Markdown
Member

@priseborough This is a log that I used in the past to replay GPS yaw data: https://logs.px4.io/plot_app?log=46feda49-d644-4ed0-acbd-868ff70779eb

bresch
bresch previously requested changes Jul 30, 2020
Comment thread EKF/python/ekf_derivation/generated/gps_yaw_fusion_generated_compare.cpp Outdated
Comment thread EKF/gps_yaw_fusion.cpp Outdated
@priseborough

Copy link
Copy Markdown
Collaborator Author

I was able to test this in SITL using a modification to ekf2_main.cpp that set the gps.heading value using the vehicle_attitude_ground_truth message and EKF2_AID_MASK = 129

Screen Shot 2020-08-11 at 8 52 32 am

A replay comparison using the log provided gave identical innovation and innovation variance sequences before:
before

and after the change:
after

@priseborough

Copy link
Copy Markdown
Collaborator Author

@bresch and @kamilritz My understanding is that the review issues have been addressed and testing is compete.

@kamilritz

Copy link
Copy Markdown
Contributor

@priseborough I would prefer, when we do the mag one first and copy the new standard way of handling the measurement jacobian to here.

@priseborough

Copy link
Copy Markdown
Collaborator Author

OK, can wait for you to get the matrix library changes required into firmware.

@priseborough priseborough force-pushed the pr-ekfSymPyGpsYawFusion branch from 3085259 to 8e52aed Compare August 11, 2020 10:27
@priseborough

Copy link
Copy Markdown
Collaborator Author

Here are the before at commit and after at commit 8e52aed results which are visually identical.

Before:
before

After:
after

@kamilritz kamilritz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just added the missing file with the auto generated code. Is there a reason why we now do not write ecl::powf?

@priseborough

Copy link
Copy Markdown
Collaborator Author

I just added the missing file with the auto generated code. Is there a reason why we now do not write ecl::powf?

We could incorporate a text find and replace, but it would have to check that the exponent was an integer.

@priseborough priseborough requested a review from bresch August 13, 2020 03:22
@priseborough priseborough dismissed bresch’s stale review August 13, 2020 03:23

Changes have been incorporated into updates and approved by second reviewer

@priseborough priseborough merged commit 0aa2f17 into master Aug 13, 2020
@priseborough priseborough deleted the pr-ekfSymPyGpsYawFusion branch August 13, 2020 03:23
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.

4 participants