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

AP_AdvancedFailsafe: option to continue the mission even after data link is recovered #23334

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

eppravitra
Copy link
Contributor

AP_AdvancedFailsafe: option to continue the mission even after data link is recovered

When set MAX_COM_LOSS to a negative number, the aircraft will continue to fly the mission even after data link is recovered. This is useful when the landing sequence is part of the flight plan.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Marking for DevCallTopic. Commit list needs cleaning up.

We also should have an autotest for this functionality.

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Aug 24, 2023
@IamPete1
Copy link
Member

In general i'm not a fan of negative parameter values changing behavior, Maybe we could add a new options bitmask parameter.

Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

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

a bit in a new AFS_OPTIONS bitmask would be best

@eppravitra
Copy link
Contributor Author

eppravitra commented Aug 29, 2023

@tridge @IamPete1 AFS_OPTIONS is now added as you guys suggested.

@peterbarker This is my first PR ever. I think I got the commit list corrected now.

@eppravitra
Copy link
Contributor Author

AP_AdvancedFailsafe: option to continue the mission even after data link is recovered

When set MAX_COM_LOSS to a negative number, the aircraft will continue to fly the mission even after data link is recovered. This is useful when the landing sequence is part of the flight plan.

In the most recent changes, a negative number is not used anymore. Instead, AFS_OPTIONS is now added.

@tridge
Copy link
Contributor

tridge commented Aug 31, 2023

looks good, @IamPete1 ?

@tridge tridge requested a review from peterbarker September 1, 2023 00:33
@tridge
Copy link
Contributor

tridge commented Sep 1, 2023

@peterbarker can you re-review?

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

A few stylistic things (and one thing we think might be important on some platforms...), but it's good enough for merge.

Thanks!

libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp Outdated Show resolved Hide resolved
libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp Outdated Show resolved Hide resolved
libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h Outdated Show resolved Hide resolved
@peterbarker
Copy link
Contributor

.... also, you're the only people on the planet running this code. While we're really careful about changes in general (and very careful in AdvancedFailsafe!), this code is completely untested except by you. If it breaks in master, you may not realise it until it doesn't work when you really need it to.

This is why we have an autotest suite. If you care enough about the feature to add it, you should probably care enough about it that it continues to function in the future, which is what regression tests are for.

@eppravitra
Copy link
Contributor Author

@peterbarker I accepted your changes, changed the semantics of the enum, and squashed all those changes. I think everything is good for a merge.

@peterbarker
Copy link
Contributor

@eppravitra looks like something went badly wrong with github infrastructure for CI for this. I've rebased this on master and force-pushed to get CI to run again.

…ink is recovered

This feature is useful when the landing sequence is part of the flight plan. New parameter AFS_OPTIONS was added.

Update libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp

Co-authored-by: Peter Barker <[email protected]>
Update libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h

Co-authored-by: Peter Barker <[email protected]>
enum convention changed
@peterbarker peterbarker merged commit 1372e48 into ArduPilot:master Sep 6, 2023
@peterbarker
Copy link
Contributor

Merged, thanks!

@eppravitra eppravitra deleted the afs-improvement2 branch September 6, 2023 14:55
@eppravitra
Copy link
Contributor Author

@Hwurzburg
Please see the proposed wiki change
ArduPilot/ardupilot_wiki#5424

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.

7 participants