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_RC_Protocol: protect SBUS against bad values #25169

Merged
merged 7 commits into from
Oct 12, 2023

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Oct 3, 2023

values at 875 on the first 4 channels are almost certainly errors. This has been seen in flight on one vehicle

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.

LGTM.

This seems like an incomplete fix. We do still have places which will read ranges from RC channels/ranges which might misbehave.

Additionally, there's some odd things happening up in the higher-numbered RC input ranges:
image

(graph RC_CHANNELS.chan9_raw RC_CHANNELS.chan10_raw RC_CHANNELS.chan11_raw RC_CHANNELS.chan12_raw RC_CHANNELS.chan13_raw RC_CHANNELS.chan14_raw RC_CHANNELS.chan15_raw RC_CHANNELS.chan16_raw RC_CHANNELS.chan17_raw RC_CHANNELS.chan18_raw)

Looks like 17 channel values are being supplied in total, and many of them are acting strangely at the end there.

@tridge tridge force-pushed the pr-sbus-protection branch from 58a2954 to 5b47429 Compare October 4, 2023 00:11
@tridge
Copy link
Contributor Author

tridge commented Oct 4, 2023

@andyp1per @peterbarker needs re-approval as I have expanded this to add a test suite and change sbus output to match sbus input, also changed HAL_Linux to use the common SBUS decoder

@tridge tridge removed the DevCallEU label Oct 4, 2023
@tridge tridge force-pushed the pr-sbus-protection branch from 5b47429 to 3037d5b Compare October 4, 2023 21:21
@tridge tridge merged commit c858b72 into ArduPilot:master Oct 12, 2023
@WickedShell
Copy link
Contributor

I have logs here from FrSky XM+ receivers glitching that glitch down to 880 on channels. Any chance we can parameterize this and raise it? From a general perspective I'd almost be interested to tag that "no RC channel input should be outside this (min, max) range" with user facing parameters and reject everything if it was outside of it.

@rmackay9
Copy link
Contributor

rmackay9 commented Apr 16, 2024

I don't know how but I think this PR has somehow introduced a bug in the SBUS output. See issue #26815

I can't see a bug however.

EDIT: No, it's not this PR. It's something after this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 4.4.1 / 4.4.1-beta2
Status: 4.4.2-beta1
Development

Successfully merging this pull request may close these issues.

5 participants