-
Notifications
You must be signed in to change notification settings - Fork 18k
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
RC_Channel: add RC_OPTIONS bit to clear RC override by RC input change #19844
base: master
Are you sure you want to change the base?
Conversation
It is NG for the FC to not get permission from the CC. FC and CC should have a handshake procedure of "YOU HAVE" and "I HAVE". PX4 has handshake in FC and MC. |
@muramura |
Txs for this. In general I think it is good practice for the pilot holding an RC to be able to take control away from a companion computer easily. It makes sense to make it easy for a pilot to do that by simply moving the sticks. |
@rmackay9 Thank you for your reviews. |
c18a147
to
79ae540
Compare
e67b372
to
d26d24d
Compare
d26d24d
to
db5b58c
Compare
@rmackay9 |
db5b58c
to
a68d098
Compare
This sounds like a good idea to me. @tatsuy did you want to rebase this? |
16207cd
to
722a833
Compare
@peterbarker Thank you for your feedback. I have rebased. |
libraries/RC_Channel/RC_Channels.cpp
Outdated
@@ -89,6 +90,20 @@ bool RC_Channels::read_input(void) | |||
success |= channel(i)->update(); | |||
} | |||
|
|||
// check if clear overrides by RC is allowed by RC_OPTIONS and any change in RC input during RC overrides | |||
if (rc().clear_overrides_by_rc() && has_active_overrides() && | |||
(channel(AP::rcmap()->roll() - 1)->rc_in_changed || |
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.
Why don't we just check to see if any of them are outside their deadzones - with the exception of throttle, which we eithre don't check or do check for a change...
... and maybe just have a uint16_t last_throttle
rather than the rc_in_changed
infrastructure.
We should probably also very that RC input is actually valid before checking any channel value!
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.
I've modified the logic so that channels other than throttle are simply checked for being outside their deadzones.
For throttle, the value when the override is activated is stored in override_start_throttle, and any change beyond the deadzone is now checked.
722a833
to
b5be7fb
Compare
@peterbarker Thank you for the review. |
This PR introduces a new option to clear the RC override, allowing the pilot to regain control by operating roll, pitch, throttle, or yaw during an RC override situation. While this functionality was previously possible using RCx_OPTION(46), the new option provides a more direct and safer method for pilots to cancel overrides using basic RC inputs.
The following settings are required
RC_OPTIONS=16384 // it allows to clear overrides by Roll/Pitch/Throttle/Yaw
RCx_OPTION=46 // (RC Override Enable) Re-enable RC overrides
I tested this on copter SITL.