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

FlightTasks: Move stick handling into library, remove FlightTaskManual #15324

Merged
merged 2 commits into from
Jul 14, 2020

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Jul 14, 2020

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 remove FlightTaskManual 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.

@MaEtUgR MaEtUgR requested review from jkflying and bresch July 14, 2020 12:01
@MaEtUgR MaEtUgR self-assigned this Jul 14, 2020
Copy link
Contributor

@jkflying jkflying left a comment

Choose a reason for hiding this comment

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

LGTM. I think this pattern will make it much easier to see where methods and parameters are coming from.

@jkflying
Copy link
Contributor

Failing SITL test is flakiness on a new check I added, I will increase the thresholds.

@jkflying jkflying merged commit 1e56eed into master Jul 14, 2020
@jkflying jkflying deleted the stick-library branch July 14, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants