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

Improve function of MIN_ALT fence #25811

Closed
wants to merge 1 commit into from

Conversation

Hwurzburg
Copy link
Collaborator

@Hwurzburg Hwurzburg commented Dec 20, 2023

FENCE_ENABLE enables or disables fences , but on boot, floor is disabled, blocking the MIN_ALT fence operation unless an overt enable occurs, ie switch or GCS command...FENCE_ENABLE itself does not impact floor state.

This PR: Enables the floor (if not enabled) once MIN_ALT is achieved. Use a flag to record the achievement to prevent further enables. This flag is reset to allow re-enables after landings disable the floor: on disarm or when below 3m(or whatever) to home alt which will allows most vehicle landings to takeoff again without disarm and the floor re-instated.

The reset algorithm for the flag which allows floor to be autoenabled again, was chosen since "landed" is not state in fixed wing and was minimal code. If the landing does not reset the flag, its no worse than present behavior and requires an overt fence enable or disarm to allow another takeoff. I will work on a separate PR to create a "landed" state call for both plane and copter that this library can use to replace the height above home reset term.

A lot of Plane SITL testing has been done, but more is will be done for Copter...

I will fix commit message a bit later

@andyp1per
Copy link
Collaborator

FWIW I fixed the same thing in here - #25698

@Hwurzburg Hwurzburg closed this Feb 29, 2024
@Hwurzburg Hwurzburg deleted the fix_min_alt_enable branch May 18, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants