EKF: convert drag fusion from Matlab to SymPy generated auto-code#894
Conversation
Also add protection for out of range value.
kamilritz
left a comment
There was a problem hiding this comment.
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. |
|
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. |
Ohh, my apologies. I was glimpsing over it too fast. I think we do the square on all other noise variables. |

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:

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