-
Notifications
You must be signed in to change notification settings - Fork 20.2k
Step 3: AP_Math: Update shaping to use improved jerk limited algorithm. #31848
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
Step 3: AP_Math: Update shaping to use improved jerk limited algorithm. #31848
Conversation
54d25fe to
39cb323
Compare
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
39cb323 to
4a9d358
Compare
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4a9d358 to
e05fdc3
Compare
|
The mem cost seams reasonably small: |
|
I get the intent, but I don't understand what this affects as it seems to change the behaviour of existing methods? |
Yes, it performs the same behaviour as the existing method but has improved stopping behaviour.
I don't think it is inferior in any way but offers significant improvements. |
e05fdc3 to
791c48b
Compare
3706bba to
2dcbc81
Compare
1b3de6e to
95b8cbd
Compare
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
487a254 to
c69b5b4
Compare
Ferruccio1984
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.
Exstensively tested on SITL. Remarkable improvement of acceleration and deceleration shaping with overall improvement of the speed profile.
A Python script has been used for testing the behavior in Guided flight mode ensuring consistency across tests.
The following plots offer a comparison of the results :

Thanks Leonard!
3c00a7b to
41d0c67
Compare
IamPete1
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.
Looks good, Thanks
156eae6 to
ac9897f
Compare
ac9897f to
88345a1
Compare
.... so we can have minimum_duration which wait_attitude does not
…tch test ensure level
88345a1 to
416db4a
Compare
|
I reverted this change to my POI autotest...I don't know how it could have passed without the delay to ARRIVE at the new position...it certainly does not if I run the test locally...the wait times out while it is still traveling to its destination...it takes over 15sec just to get there, and it must be that the mount check is loosened enough that it passes while its far enough away and low enough to pass..... |




The current real time S-Curves have two problems that this PR addresses:
This PR produces the full deceleration specified by the square root controller and maintains the time constant based approach to the position target. This time constant based approach makes this algorithm act as a filter making it suitable for noisy or inputs and means that the algorithm does not oscillate or buzz near the set-point.
Below is a plot showing the original square root controller, the current Real Time S Curve, This Jerk Square Root algorithm and the standard rectangular jerk S Curve (Optimal).
There are two reasons we would choose not to use the Optimal solution:
Both of these make Optimal less appealing to high update rate applications.
Meant to be merged after #31870 and #31848