-
Notifications
You must be signed in to change notification settings - Fork 344
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
Check dt in updateFromVelocity #1481
Conversation
Signed-off-by: Tony Najjar <[email protected]>
I'm fine with this in general, but in case dt=0 nothing bad happens anyways? |
if it's 0, then you get a division by 0 further down |
There is more to be debugged as discussed but this PR can already be merged I would say. It already fixes a major bug for me because if one dt=0 goes through, the accumulators always return nan afterwards |
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.
Sorry, I got confused because the arguments left/right_vel are no velocities but position delta values. If it would be velocities we would not need to divide by dt in this method, and integrating with a step size of zero would just do nothing.
We really should rewrite this API, but I understand your point and we can merge this as a temporary fix.
Signed-off-by: Tony Najjar <[email protected]> (cherry picked from commit 0736e6c)
Co-authored-by: Tony Najjar <[email protected]>
updateFromVelocity
is not only called fromupdate
but also directly ifposition_feedback
is false so we should also check there is dt is too small