-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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: ignore invalid pilot throttle #25633
Plane: ignore invalid pilot throttle #25633
Conversation
@@ -547,9 +547,7 @@ void Plane::set_servos_controlled(void) | |||
control_mode == &mode_fbwa || | |||
control_mode == &mode_autotune) { | |||
// a manual throttle mode | |||
if (!rc().has_valid_input()) { |
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.
Now were handling it in the get_throttle_input
and get_adjusted_throttle_input
calls we don't need this check.
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.
it would be good to test QSTAB, QACRO, QHOVER, QLOITER, make sure they don't lose height during the short rc failsafe period
Added a commit to be sure that quadplane behaves the same, it is a re-implementation of the no deadzone case of Also re-checked with Tested Q modes to make sure we don't fall out of the sky. Qstab and Qacro we get hover throttle. Qhover and Qloiter a slow descent. |
f7df379
to
35524b9
Compare
float ret = plane.channel_throttle->get_control_in(); | ||
if (plane.reversed_throttle) { | ||
// RC option for reverse throttle has been set | ||
ret = -ret; |
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.
This is almost certainly wrong for Quadplanes, but it is the current behavior.
…me as Plane::get_throttle_input did
35524b9
to
9b7f305
Compare
Extract from #25416 superseding #25631
This now always ignores pilot throttle if there is invalid RC. Currently on master you can get stuck at your last throttle in some cases with guided or suppressed passthrough and manual mode. This should be covered by the
set_control_in
call here:ardupilot/ArduPlane/radio.cpp
Line 278 in bf6bd3a
However that does not fix all cases.
If we call
get_throttle_input(true)
to get the no deadzone value we callget_control_in_zero_dz
:ardupilot/ArduPlane/reverse_thrust.cpp
Lines 123 to 139 in bf6bd3a
However,
get_control_in_zero_dz
does not usecontrol_in
it usesradio_in
so ourset_control_in
call is bypassed.ardupilot/libraries/RC_Channel/RC_Channel.cpp
Lines 391 to 397 in bf6bd3a
ardupilot/libraries/RC_Channel/RC_Channel.cpp
Lines 361 to 379 in bf6bd3a
The problem with
get_adjusted_throttle_input
is that is usesnorm_input
with again bypassescontrol_in
Recreation:
Turn off short fail-safe (
FS_SHORT_ACTN
3)Arm and go to full throttle in manual.
Have a RC fail-safe, (
SIM_RC_FAIL
1)Master:
Throttle remains at 100% until long action.
PR:
Throttle goes to 0 as soon as RC is lost, throttle is output again once in RTL.
![image](https://private-user-images.githubusercontent.com/33176108/285621137-62149853-4bc9-4e01-a5f9-0d717cb44a35.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMjMyMjMsIm5iZiI6MTcyMTEyMjkyMywicGF0aCI6Ii8zMzE3NjEwOC8yODU2MjExMzctNjIxNDk4NTMtNGJjOS00ZTAxLWE1ZjktMGQ3MTdjYjQ0YTM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDA5NDIwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1N2UxMjZhZDgyYTE3Y2FmZWZkZjIwNTBhOGI5MTJlNTY3YjZiMTdmZjlmYjVkMTg0MzE5NGVkODc2NWFkMGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qjAx7lQmX9X-rACMcjlvLnv63SvTlrDKd8PktXmOxE8)
The same issue also affects roll/pitch/yaw inputs in some modes....