Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ekf2: migrate fuse_airspeed to SymForce #20333

Merged
merged 4 commits into from Oct 3, 2022
Merged

ekf2: migrate fuse_airspeed to SymForce #20333

merged 4 commits into from Oct 3, 2022

Conversation

bresch
Copy link
Member

@bresch bresch commented Sep 30, 2022

Describe problem solved by this pull request

Copy/paste and manually modifying auto-generated code is prone to human errors; it takes about a day of painful work to replace the existing auto-generated code if anything in the derivation is changed.

Describe your solution

Use SymForce to generate compatible C++ code and only use function calls within PX4

Test data / coverage

SITL test with make px4_sitl gazebo_plane__windy

Before:
DeepinScreenshot_select-area_20220930142648

This PR:
DeepinScreenshot_select-area_20220930142632

@dagar
Copy link
Member

dagar commented Sep 30, 2022

I added a little cmake helper to re-run the Symforce code generation. By default it shouldn't do anything.


const float predicted_airspeed = sqrtf(IV2);
const float R = sq(math::constrain(_params.eas_noise, 0.5f, 5.0f) *
math::constrain(airspeed_sample.eas2tas, 0.9f, 10.0f));
Copy link
Member

Choose a reason for hiding this comment

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

10 seems kind of high for eas2tas, I think that would be > 30 km.

@bresch bresch marked this pull request as ready for review October 3, 2022 12:08
@bresch bresch requested a review from dagar October 3, 2022 12:08
@bresch
Copy link
Member Author

bresch commented Oct 3, 2022

Added a unit test to compare the previous auto-generated code with the new functions to make sure the results are numerically identical.

@dagar dagar merged commit 4b687be into main Oct 3, 2022
@dagar dagar deleted the pr-ekf2-symforce branch October 3, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants