Copter: Trust get-pilot-desired methods check RC input for validity #30070
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.
.... which they do, for the most part.
This PR removes special-case logic in Loiter and ZigZag which check for radio failsafe before updating the loiter controller with values returned from them (etc.).
Those methods already check that RC input is good (improvements coming there, however!). So rely on those methods returning sensible values when there's no RC present. Several other modes already make the assumption that these methods do sensible things (eg.
ModeAltHold
!).Note that
clear_pilot_desired_acceleration
just sets(0, 0)
, andget_pilot_desired_lean_angles
sets target-roll/target-pitch to zero if RC input is bad).There is a second fix in here where checks were insufficient when looking at RC values. This is the- this was moved to a different PRupdate_simple_mode
method matches. We not only have to check that a new frame has been received, but that the values are generally good ie. not coming in at bind-mode values. This is a minimal patch to allow for the first patch to go in - there's plenty else wrong in the radio codepath which will be fixed in a future PR (eg. incorporating bind-time values into the throttle filter, setting the throttle-zero flag). This is also a bugfix for several methods which already transform the pilot inputs.