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

sympy generated code vs final code #1042

Open
tianzhuqiao opened this issue Sep 27, 2023 · 1 comment
Open

sympy generated code vs final code #1042

tianzhuqiao opened this issue Sep 27, 2023 · 1 comment

Comments

@tianzhuqiao
Copy link

Thanks for the great project. I am reading the doc and code; and for some fusion, I am not sure how we use the generated code (from python sympy) in the final code. For example,

this is the generated code for gps yaw fusion

and this is the final code

const float HK0 = sinf(_gps_yaw_offset);

Looks like they doesn't match with each other. Do I miss something? Or do we update the model (either in sympy or in the final code)? Thanks!

@bresch
Copy link
Member

bresch commented Sep 28, 2023

Hi @tianzhuqiao , this repo is not updated anymore, we moved everything to PX4 directly. We also migrated the derivation to SymForce, this allows to change the derivation in python, re-generate the code in a couple of seconds and test immediately without having to copy-paste anything.

Here is the new derivation: https://github.com/PX4/PX4-Autopilot/blob/8ea04b0f8fd896c73f0fd47e92957072f31d46f1/src/modules/ekf2/EKF/python/ekf_derivation/derivation.py#L392-L414

Here is for example the auto-generated code for the GNSS yaw fusion: https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/ekf2/EKF/python/ekf_derivation/generated/compute_gnss_yaw_pred_innov_var_and_h.h

And here is where the generated function is used: https://github.com/PX4/PX4-Autopilot/blob/8ea04b0f8fd896c73f0fd47e92957072f31d46f1/src/modules/ekf2/EKF/gps_yaw_fusion.cpp#L100
No more mix of auto-generated code in the cpp files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants