Assertion in btJacobianEntry when using SphereShape [solved]

rTi
Posts: 9
Joined: Fri Nov 02, 2007 10:45 pm

Assertion in btJacobianEntry when using SphereShape [solved]

Post by rTi »

Hello.

I have a little problem. As soon as I attach a sphere shape to my dynamics world, the following assertion happens:

Code: Select all

Assertion failed: (m_Adiag > btScalar(0.0)), function btJacobianEntry, file src/BulletDynamics/ConstraintSolver/btJacobianEntry.h, line 53.
I can reproduce it somehow, I can work around it. But I do not understand why this happens and what the assertion wants to tell me.

So what I am asking here is: When does this assertion occur? Is there any common mistake I made?

Thanks in advance
rTi
Last edited by rTi on Tue Dec 04, 2007 9:15 am, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Assertion in btJacobianEntry.h when using SphereShape

Post by Erwin Coumans »

This assertion can be caused due to various reasons, but usually it means the constraint solver tries to solve a collision in a pair of two static rigid bodies (both mass zero).

This should have filtered out at an earlier stage. Did you make sure to set the collision filter flags accordingly? Did you use addRigidBody(...) to add the sphere? See

Code: Select all

void    btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body)
{
        if (!body->isStaticOrKinematicObject())
        {
                body->setGravity(m_gravity);
        }

        if (body->getCollisionShape())
        {
                bool isDynamic = !(body->isStaticObject() || body->isKinematicObject());
                short collisionFilterGroup = isDynamic? short(btBroadphaseProxy::DefaultFilter) : short(btBroadphaseProxy::StaticFilter);
                short collisionFilterMask = isDynamic?  short(btBroadphaseProxy::AllFilter) :   short(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);

                addCollisionObject(body,collisionFilterGroup,collisionFilterMask);
        }
}
Hope this helps
Erwin
rTi
Posts: 9
Joined: Fri Nov 02, 2007 10:45 pm

Re: Assertion in btJacobianEntry.h when using SphereShape

Post by rTi »

Thanks for the fast answer.
I am using addRigidBody() but I am not setting any filters.
I will look deeper into it.
rTi
Posts: 9
Joined: Fri Nov 02, 2007 10:45 pm

Re: Assertion in btJacobianEntry.h when using SphereShape

Post by rTi »

Could creating two identical (size, weight) dynamic sphere shapes at the same position in the same time step cause this behaviour?
In contrast, the same thing works with box shapes.

Of course, this is not the way to create a stable simulation. :)

If this miss usage is the reason, I can stop searching. I just frighten a different, more general problem in my Bullet binding.

Thanks in advance.
Greetings, rTi
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Assertion in btJacobianEntry.h when using SphereShape

Post by Erwin Coumans »

Yes, this problem has been fixed in the current Subversion source code of Bullet, and will be available in Bullet 2.65.

See also http://www.bulletphysics.com/Bullet/php ... f=9&t=1681

Thanks!
Erwin
rTi
Posts: 9
Joined: Fri Nov 02, 2007 10:45 pm

Re: Assertion in btJacobianEntry when using SphereShape [solved]

Post by rTi »

Great news.
Thanks a lot.

And keep up the good work.