-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commander: Separate out manual control setpoint processing #16878
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
Conversation
85b3d44 to
98c7c61
Compare
|
As a response to @dagar 's feedback:
I prepared to gate all this processing on |
|
Arming/disarming not working as expected on a vehicle without props. Debugging. |
98c7c61 to
9226e30
Compare
|
I found the issue: ebbc098 |
ebbc098 to
abe5135
Compare
|
Fixed, squashed and rebased. |
julianoes
left a comment
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.
Couple of comments but overall that's a very nice cleanup, exactly the sort of thing we should do step by step.
|
|
||
| using namespace time_literals; | ||
|
|
||
| enum OverrideBits { |
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 not enum class?
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.
It gets used in combination with a "bitwise and" not in a direct comparison because the parameter is a bitfield. Would you define the bitwise and operator in the class or how can it be done more easily?
That's probably also why it was added in this way:
https://github.com/PX4/PX4-Autopilot/pull/13618/files#diff-33729b6612e70db2803e6b18b64a47c71e70eaf1d6b69fd233a34b3b0408a806R261
| * Check for manual control input changes and process them | ||
| * @return true if there was new data | ||
| */ | ||
| bool update(); |
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'm not super happy with the name update() for something that also returns something but I also don't have a better suggestion, unless maybe couldUpdate() or tryUpdate()?
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 thought about this because I also don't like if everything is called update() for e.g. text search reasons. But updated() is wrong because it actually does something and I couldn't come up with something better. Maybe checkUpdateAndProcess()? Seems clunky and doesn't really help does it?
7789288 to
d063977
Compare
Instead of deflection mainly because: - Spring loaded throttle -> bad user experience - Stale RC data -> Vehicle not savable
Separating the different arming methods is the next step.
addressing review from @bresch, @julianoes and @JonasVautherin
julianoes
left a comment
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.
Thanks for the fixes @MaEtUgR!
|
Thank you for the reviews @julianoes and @bresch and @JonasVautherin, that really helped a lot. I'll follow up with further improvements like freeing commander from the rc_found_once logic, doing all the processing in the process() function, separating arming methods. |

Describe problem/solution in this pull request
New
ManualControlclass for handlingmanual_control_setpoint(and later switches) holding subscription, parameters and state necessary. It handles in this pr RC loss, RC override, RC arming/disarming.Note: This is the first stab at it and I'd like to do incremental steps to not create a non-understandable monster pr.
Test data / coverage
I tested the different cases during development but will do a final pass testing all the things with this state.
Additional context
Follow up after being in the loop from reviewing #16266 and doing work on RC override.