-
Notifications
You must be signed in to change notification settings - Fork 525
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
fix mistake in jerk limit #388
base: melodic-devel
Are you sure you want to change the base?
fix mistake in jerk limit #388
Conversation
The same formula is used in diff_drive_controller. |
I fixed it too thanks. Is there a way in this repo to factorize files between packages or not? |
Creating a base package... (#377) |
...and now the limits test is failing. |
I have fixed the tests doubling the jerk limits. If you prefer to modify end values (after the simulation), tell me. |
I have the feeling that there is a notation issue, |
Yes I thought that the mistake came from the two iterations process (there is 2 times dt between
You can see it a different way if you define the jerk as the difference between current and last acceleration. In this process it 'spans' only one dt. And the computation of each acceleration is independant (each one use one dt). That was I try to explain with the maths above. Notice that I did not verify the formulas to find the mistake, I was plotting the jerk and saw it was doubled. Then I got back to the code and the maths. |
I ran 3 times the tests and it fails due to instability of
|
For what it's worth, we've been using these speed limiter functions on Ignition Gazebo, and while writing tests for it today, I noticed there was a mistake on the jerk calculation. The change proposed here fixed my tests in gazebosim/gz-math#194. |
This LGTM, glad to hear that the issue has been identified by others and the fix has been validated there too. Plus, the math makes sense. I think part of the reason this got mixed up at first is because of the variable naming. I think it becomes much clearer as follows, though I admit this does take a few extra cycles since it divides.
|
The mistake is not only on melodic.
There's not a factor 2 in the formulas.