-
Notifications
You must be signed in to change notification settings - Fork 53
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
Integrate x and y swerve sample values #1142
base: main
Are you sure you want to change the base?
Conversation
Need to test this |
3267060
to
4fa3531
Compare
lerpedXPos += lerpedVXPos * dt; | ||
lerpedYPos += lerpedVYPos * dt; |
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.
This using the velocity of the next timestep instead of the current one is suspicious.
Signed-off-by: Jade Turner <[email protected]>
Signed-off-by: Jade Turner <[email protected]>
d4cf064
to
e5468a8
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.
The correct integration equations are:
xₖ₊₁ = xₖ + vₖt + 0.5aₖt²
vₖ₊₁ = vₖ + aₖt
This PR used the following instead:
vₖ₊₁ = vₖ + aₖt
xₖ₊₁ = xₖ + vₖ₊₁t
= xₖ + (vₖ + aₖt)t
= xₖ + vₖt + aₖt²
Gah this would explain my issue thanks. Will write out and test |
No description provided.