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

mag_control: fuse fake heading during leveling fine alignment #17964

Merged
merged 4 commits into from Jul 27, 2021

Conversation

bresch
Copy link
Member

@bresch bresch commented Jul 22, 2021

I recently centralized the mag reset call in mag_control.cpp and disabled the mag fusion during the leveling fine alignment phase (a685987#diff-4e4b2b3cba938a36a704d2d452e4ca2ae427d40254a8c63a5278b0ded821754cR70). This was in theory the correct way of doing it, except that without any heading fusion while fusing fake position (quasi-stationary alignment), the quaternion variance isn't reducing fast enough.

This PR enables fake "zero innovation" heading fusion during the fine alignment phase to speed up the quaternion convergence.

Also enables fake heading fusion when the mag has been rejected (mag_fault flag in case of yaw emergency reset for example) to avoid unconstrained yaw variance growth in case of long static (i.e.: no acceleration) flight, where the heading isn't observable anymore.

Tested on a drone where the fine alignment phase wasn't able to complete anymore (triggered by the at_rest flag never being true; due to another unrelated issue).

DeepinScreenshot_select-area_20210722123245

Note that the issue is not showing up on most setups, because when the vehicle is detected "at rest", the fake position fusion has a lower observation noise that allows the quaternion to converge much faster.

@bresch bresch added the EKF2 label Jul 22, 2021
@bresch bresch requested a review from priseborough July 22, 2021 10:34
@bresch bresch self-assigned this Jul 22, 2021
@bresch bresch added this to the Release v1.12.0 milestone Jul 22, 2021
@bresch
Copy link
Member Author

bresch commented Jul 26, 2021

backport to v1.12 (using ECL) PX4/PX4-ECL#1029

@bresch bresch closed this Jul 26, 2021
@bresch bresch reopened this Jul 26, 2021
@bresch bresch requested a review from dagar July 26, 2021 14:45
@bresch bresch force-pushed the pr-tilt-align-fake-heading-fuse-upstream branch from 6ce3a39 to 0ed3074 Compare July 27, 2021 08:02
@bresch bresch requested a review from priseborough July 27, 2021 08:07
@bresch bresch merged commit 17ebcd2 into master Jul 27, 2021
@bresch bresch deleted the pr-tilt-align-fake-heading-fuse-upstream branch July 27, 2021 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants