FlightTasks: Move stick handling into library, remove FlightTaskManual #15324
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe problem solved by this pull request
One of the first steps towards using libraries instead of the inheritance structure. All flight tasks that wanted to use sticks had to inherit from
FlightTaskManual
because that abstract class handled the sticks.Describe your solution
I move stick handling (as is) into the
Sticks
utility class and removeFlightTaskManual
and hence one layer of inheritance structure. I know that's just a small step but it shows me what the usual problems are and I'll continue the effort such that we don't end up with a huge unreviewable pr.Test data / coverage
I SITL tested and the sticks work just like before.
Additional context
We realized more than a year ago that with increasing flight task complexity that the inheritance structure is becoming a dead end. So it was mentioned as a todo to move towards libraries for reuse instead in the PX4 dev summit 2019 and was one of the things that isn't tackled yet and I'm looking into starting slowly such that we have the improvement in the future.