Skip to content
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

btRaycastVehicle.cpp: forward impulse way too strong when sideImpulse==0 #3220

Closed
wants to merge 0 commits into from

Conversation

stephengold
Copy link
Contributor

@stephengold stephengold commented Jan 10, 2021

This pull request fixes a recently discovered bug in btRaycastVehicle. When a vehicle at rest starts moving, sometimes its forward impulse is much too large, causing it to immediately reach its steady-state speed.

In my application (a particular vehicle configuration on a level surface) the impulse was 140x too large about 18% of the time. The bug was highly reproducible: it happened for some starting locations on the surface but not for others. I tracked it back to line 612 of btRaycastVehicle.cpp: m_sideImpulse[wheel] was either -0 (for bad starting locations) or roughly -2e-09 (for good ones).

For such a tiny side impulse to reduce the forward impulse by 140x makes no sense, physically. I suspect the test in line 612 was originally a hand optimization from at time when the loop was scaling m_sideImpulse[wheel] only. Removing the test fixed the bug.

@stephengold
Copy link
Contributor Author

After 8 months, I'm curious why this PR hasn't been integrated. If the Bullet project is no longer accepting PRs from outsiders, or if it's no longer accepting PRs to "BulletDynamics/Vehicle", that would be nice to know.

@stephengold
Copy link
Contributor Author

@erwincoumans What's the next step for this PR?

@stephengold
Copy link
Contributor Author

Contact me by e-mail if you want the diff for this bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant