Skip to content

Copter: avoid updating simple-mode values when RC input is invalid #30071

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

Merged

Conversation

peterbarker
Copy link
Contributor

if we are at bind-time values then we still get new radio frames, they're just not something we should use

Tested in SITL by setting a breakpoint within the new clause. When we're in there having set SIM_RC_FAIL to 2 the channels are definitely using bind-time values.

if we are at bind-time values then we still get new radio frames, they're just not something we should use
Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this. I think this is OK.

My only question was whether we should put this new check above or below the "ap.new_radio_frame = false;" line. I think it makes sense to put it afterwards as this PR has done though because we are "consuming" the frame it's just that we've also decided that we don't want to use it for anything.

@rmackay9
Copy link
Contributor

as a side note, the ap.new_radio_frame is now only used by simple mode so we could give it a more specific name to make that clear. This doesn't really matter though for now.

@peterbarker
Copy link
Contributor Author

as a side note, the ap.new_radio_frame is now only used by simple mode so we could give it a more specific name to make that clear. This doesn't really matter though for now.

I'm looking forward to having an rc().last_valid_input_ms() call we can make. When we've updated these simple-mode values we note down the timestamp for the values we just munged, and only munge them again if the timestamp has changed.

@peterbarker peterbarker merged commit 63d7973 into ArduPilot:master May 14, 2025
81 of 84 checks passed
@peterbarker peterbarker deleted the pr/simple-mode-check-valid-rc branch May 14, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants