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

Fence warn at the margins #28840

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andyp1per
Copy link
Collaborator

@andyp1per andyp1per commented Dec 11, 2024

This PR allows you to get a repeated warning when flying outside FENCE_MARGIN but inside the fence itself. Can be enabled by setting FENCE_OPTIONS=4. Multiple people have requested this because they are required to have a hard fence with failsafe action for regulatory reasons but want to know when they are close so they can avoid the action (typically when flying manually)

@andyp1per andyp1per force-pushed the pr-fence-warn-margin branch from ce3674f to 9fbfa49 Compare December 12, 2024 14:05

// emit a message indicated we're newly-breached, but not too often
if (option_enabled(OPTIONS::MARGIN_BREACH)
&& AP_HAL::timeout_expired(_last_margin_breach_notify_sent_ms, now, 1000U)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

parameterize "not too often"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm loathe to add another parameter unless its really required - we have many other repeating messages in warning situations that do not have a configurable repeat interval

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, but this seems to be every second. (Do I have that wrong?) That seems pretty often to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, open to a better value - although you obviously can turn it off. You only get the warning when you are inside the fence but outside the margin - its supposed to be naggy.

@andyp1per andyp1per force-pushed the pr-fence-warn-margin branch from 9fbfa49 to 336ea4e Compare December 13, 2024 20:44
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants