bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.51k stars 2.87k forks source link

Assert in btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup. btAssert(fsum > SIMD_EPSILON); (was googlecode Issue 666) #109

Closed erwincoumans closed 4 years ago

erwincoumans commented 10 years ago

See https://code.google.com/p/bullet/issues/detail?id=666&colspec=Modified%20ID%20Type%20Stars%20Status%20Owner%20Summary

vfekete commented 10 years ago

I have the same problem for btSliderConstraint where body is made out of btShapeHull (I don't observe assertion failure in case of primitive collision shapes cylinder). Concerning the bullet version, I pulled out the last one (063a0344acdae57df0321d898f1375d68a152aaf) and saw, that faulty part is line 1440 (as was written before about bug 666) :

1439 btScalar fsum = btFabs(sum); 1440 btAssert(fsum > SIMD_EPSILON); 1441 solverConstraint.m_jacDiagABInv = fsum>SIMD_EPSILON?btScalar(1.)/sum : 0.f;

Although I don't understand the reason for all those dot products being computed as "sum" in lines before 1439, one can see, that the fsum is checked for being bigger than SIMD_EPSILON properly at line 1441 which is after assert. This must be the correct (inteded) behavior in case of fsum being "0" (assertion failed). So i simply commented the line 1440 and everything works as it supposed to - aka constraints behave properly.

Imho assertion is just a raised finger for developer, that there is a situation that should not happen, however the code counts with this situation and behaves properly as far as I can see. (hope this helps anybody to temporary fix this)

erwincoumans commented 10 years ago

If sum is 0, there is an issue with the constraint that shouldn't happen. Can you recreate the issue in a modified Bullet demo?

vfekete commented 10 years ago

sure, I changed ConstraintDemo (pulled fresh repo today - 07/01/14),

diff : http://nova.dnp.fmph.uniba.sk/~fekete/bullet/ConstraintDemo.cpp.diff cpp file : http://nova.dnp.fmph.uniba.sk/~fekete/bullet/ConstraintDemo.cpp and test wavefront object: http://nova.dnp.fmph.uniba.sk/~fekete/bullet/test.obj

and of course the 'test.obj' file must be in correct directory while debugging (in my case it's build3/vs2010/)

erwincoumans commented 4 years ago

closing out-of-date issues.

markusstephanides commented 2 years ago

I still have this issue, occurs only in debug mode. Is there any solution for this yet?