-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Refactor ManualPositionSmoothVel and ManualAltitudeSmoothVel #12943
Conversation
2ec4ca2
to
1b880a5
Compare
1b880a5
to
1d19082
Compare
Rebased on #12909 . |
2fa0ae2
to
92fbaac
Compare
Rebased on master after the merge of #12909 |
src/systemcmds/tests/test_matrix.cpp
Outdated
@@ -578,7 +578,7 @@ bool MatrixTest::sliceTests() | |||
}; | |||
|
|||
Matrix<float, 2, 2> C(data_2); | |||
A.set(C, 1, 1); |
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.
FYI @jkflying
See also the other modifications in this file.
92fbaac
to
bdd2934
Compare
@PX4/testflights Could you test this PR in -at least- attitude and position modes please?
Thanks! |
Status:
|
Tested on Pixhawk 4 v5 f-450 Altitude mode: log: Position control: log: pixhawk4 mini v5 f-450 Altitude mode: log: Position control: log: |
Tested on CUAV+ V5:Altitude mode: log: Position control: log: Tested on PixRacer V4:Altitude mode: log: Position control: log: |
…it XY and Z axes Next step is to move as much as possible to a library in order to reuse the Z axis in the Altitude FlightTask
Set the classes as final and set destructor to non-virtual
…implementing the logic
Use .xy() for Vector2 -> Vector3 assignment
bdd2934
to
754073b
Compare
@MaEtUgR It's all ready now and tested quite a bit. The logs looks fine and I just need a quick review and approval please. |
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.
Nice refactor! A lot more structured.
With #12909 , we can get rid of a lot of corner case handling logic and I decided to refactor completely the FlightTaskManualPositionSmoothVel and FlightTaskManualAltitudeSmoothVel to make them cleaner, easier to read and bug-free.
To do that, I'll encapsulate the usage of the jerk-limited trajectory generator with the position lock logic into an object that can be used by both flight tasks. Being in a new class, I'll also have unit test for it.
First step I made so far is to split the logic in small functions and decouple XY and Z axes. Next step is to move that logic into a class. There will be a base pure virtual interface class, a class for XY and one for Z, where XY is the vector version of Z.