Skip to content

RC_Channel: understand ignore-receiver when reading rc inputs#32488

Merged
rmackay9 merged 3 commits intoArduPilot:masterfrom
peterbarker:pr/fix-rc-input-processed
Mar 31, 2026
Merged

RC_Channel: understand ignore-receiver when reading rc inputs#32488
rmackay9 merged 3 commits intoArduPilot:masterfrom
peterbarker:pr/fix-rc-input-processed

Conversation

@peterbarker
Copy link
Copy Markdown
Contributor

Summary

Corrects problem where we consume invalid channel values when throttle-failsafe is ignored but we also have RC_OPTIONS set to 1 to ignore the receiver

Testing (more checks increases chance of being merged)

  • Checked by a human programmer
  • Tested in SITL
  • Tested on hardware
  • Logs attached
  • Logs available on request
  • Autotest included (it is coming)

Description

previously this option only gated whether we read data from the HAL into our radio_in state.

but that would mean read_input would still return true, even if we didn't actually read data from the receiver into the radio state. And that means everything in (e.g. Copter::read_radio thinks we have good channel data when we absolutely do not, meaning has_valid_input is true. Which is bad.

Comment thread libraries/RC_Channel/RC_Channels.cpp
@rmackay9 rmackay9 mentioned this pull request Mar 19, 2026
57 tasks
@peterbarker peterbarker force-pushed the pr/fix-rc-input-processed branch from 9237013 to 61280a7 Compare March 19, 2026 09:38
@peterbarker
Copy link
Copy Markdown
Contributor Author

I broke this in #26164

So a regression from 4.5.7

I've added the autotest I used to bisect it.

@peterbarker peterbarker force-pushed the pr/fix-rc-input-processed branch 4 times, most recently from 44a8846 to 0aa4f5c Compare March 26, 2026 02:13
@peterbarker peterbarker force-pushed the pr/fix-rc-input-processed branch 3 times, most recently from b76de98 to b4c6d65 Compare March 27, 2026 03:08
throttle-down won't have an effect.  Throttle-up *might* have an effect, so we need to protect against that.

We want to leave the vehicle at zero throttle after the RTL IMO, and zero is a better choice than middle while we *are* doing RTL

throttle-down won't have an effect.  Throttle-up *might* have an effect, so we need to protect against that.

We want to leave the vehicle at zero throttle after the RTL IMO, and zero is a reasonable choice while we *are* doing RTL.
previously this option only gated whether we read data from the HAL into our radio_in state.

but that would mean read_input would still return true, even if we didn't actually read data from the receiver into the radio state.  And that means everything in (e.g. Copter::read_radio thinks we have good channel data when we absolutely do not, meaning has_valid_input is true.  Which is bad.
@peterbarker peterbarker force-pushed the pr/fix-rc-input-processed branch from b4c6d65 to 334a456 Compare March 27, 2026 03:09
@peterbarker
Copy link
Copy Markdown
Contributor Author

The test modifications all pass before this change - with the exception of the test added in this PR: peterbarker#34

@rmackay9 rmackay9 merged commit de51149 into ArduPilot:master Mar 31, 2026
107 checks passed
@peterbarker peterbarker deleted the pr/fix-rc-input-processed branch March 31, 2026 03:48
@Georacer Georacer moved this from Pending to 4.7.0-beta3 in 4.7 Backports Apr 10, 2026
@Georacer Georacer mentioned this pull request Apr 10, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4.7.0-beta3

Development

Successfully merging this pull request may close these issues.

5 participants