-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
Plane: don't trigger RC failsafe until RC has been received for the first time #23189
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure) | |
} | ||
//are arming checks disabled? | ||
if (checks_to_perform == 0) { | ||
return true; | ||
return mandatory_checks(display_failure); | ||
} | ||
if (hal.util->was_watchdog_armed()) { | ||
// on watchdog reset bypass arming checks to allow for | ||
|
@@ -91,6 +91,8 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure) | |
ret = false; | ||
} | ||
|
||
ret &= rc_received_if_enabled_check(display_failure); | ||
|
||
#if HAL_QUADPLANE_ENABLED | ||
ret &= quadplane_checks(display_failure); | ||
#endif | ||
|
@@ -124,6 +126,19 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure) | |
return ret; | ||
} | ||
|
||
bool AP_Arming_Plane::mandatory_checks(bool display_failure) | ||
{ | ||
bool ret = true; | ||
|
||
ret &= rc_received_if_enabled_check(display_failure); | ||
|
||
// Call parent class checks | ||
ret &= AP_Arming::mandatory_checks(display_failure); | ||
|
||
return ret; | ||
} | ||
|
||
|
||
#if HAL_QUADPLANE_ENABLED | ||
bool AP_Arming_Plane::quadplane_checks(bool display_failure) | ||
{ | ||
|
@@ -411,3 +426,21 @@ bool AP_Arming_Plane::mission_checks(bool report) | |
#endif | ||
return ret; | ||
} | ||
|
||
// Checks rc has been received if it is configured to be used | ||
bool AP_Arming_Plane::rc_received_if_enabled_check(bool display_failure) | ||
{ | ||
if (rc().enabled_protocols() == 0) { | ||
// No protocols enabled, will never get RC, don't block arming | ||
return true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is badly named function if it returns true for "rc_received_check()" when there is no RC There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed to |
||
} | ||
|
||
// If RC failsafe is enabled we must receive RC before arming | ||
if ((Plane::ThrFailsafe(plane.g.throttle_fs_enabled.get()) == Plane::ThrFailsafe::Enabled) && | ||
!(rc().has_had_rc_receiver() || rc().has_had_rc_override())) { | ||
check_failed(display_failure, "Waiting for RC"); | ||
return false; | ||
} | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As well as the new check we gain the base class checks in this case:
ardupilot/libraries/AP_Arming/AP_Arming.cpp
Lines 1589 to 1598 in 9cc8622
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wont this prevent RC less operation? never advised but was not prohibited before....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you just have to turn off the RC failsafe.