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

EKF: convert drag fusion from Matlab to SymPy generated auto-code#894

Merged
priseborough merged 3 commits into
masterfrom
pr-ekfSymPyDragFusion
Aug 18, 2020
Merged

EKF: convert drag fusion from Matlab to SymPy generated auto-code#894
priseborough merged 3 commits into
masterfrom
pr-ekfSymPyDragFusion

Conversation

@priseborough

Copy link
Copy Markdown
Collaborator

Before and after innovations, innovation variances and wind state estimates from replay of gazebo SITL log data with EKF2_AID_MASK set to 33 to activate drag fusion.

Before:
before

After:
after

Output from the auto-code comparison test program shows expected amount of difference between Matlab and SyPmy generated code:

Pass: Specific Force X axis Hfusion max diff fraction = 0.000000e+00
Pass: Specific Force X axis Kfusion max diff fraction = 1.161862e-06
Pass: Specific Force Y axis Hfusion max diff fraction = 0.000000e+00
Pass: Specific Force Y axis Kfusion max diff fraction = 2.331720e-06

Comment thread EKF/drag_fusion.cpp
Comment thread EKF/drag_fusion.cpp Outdated
@priseborough

Copy link
Copy Markdown
Collaborator Author

Here's the replay result with the fix to the R_ACC value. The slightly slower wind state convergence for the SymPy vs Matlab result has been eliminated.

Screen Shot 2020-08-16 at 5 01 36 pm

@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.

We should change the drag_noise param description in the common.h file as well

@priseborough

Copy link
Copy Markdown
Collaborator Author

We should change the drag_noise param description in the common.h file as well

Description has correct units. Variable name could be better, eg drag_noise_variance, but that would also require a change to the ekf2 module and the declaration comments and parameter description are consistent and correct so would prefer to leave alone.

@kamilritz

Copy link
Copy Markdown
Contributor

drag_noise (as standard deviation) described here can not have the same units as sq(drag_noise) (as variance). I would argue it should be adapted in common.h and ekf2 params.

@priseborough

Copy link
Copy Markdown
Collaborator Author

drag_noise (as standard deviation) described here can not have the same units as sq(drag_noise) (as variance). I would argue it should be adapted in common.h and ekf2 params.

It's not being squared (it is copied across to R_ACC), the term 'standard deviation' is not mentioned anywhere in relation to this parameter and it is consistently described as a 'observation noise variance' in the module and ecl library so I don't understand what the issue is.

@kamilritz

Copy link
Copy Markdown
Contributor

It's not being squared (it is copied across to R_ACC), the term 'standard deviation' is not mentioned anywhere in relation to this parameter and it is consistently described as a 'observation noise variance' in the module and ecl library so I don't understand what the issue is.

Ohh, my apologies. I was glimpsing over it too fast. I think we do the square on all other noise variables.

@priseborough priseborough merged commit fd849e0 into master Aug 18, 2020
@priseborough priseborough deleted the pr-ekfSymPyDragFusion branch August 18, 2020 07:06
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.

2 participants