physicsphysics-enginebulletphysicsbullet

Twitching of joints in btMultiBody


I have simple vehicle based on btMultiBody. Referring to the attached GIF, its base is the rectangular block in the center and it contains four cylindrical wheels which are attached using btMultiBody::setupRevolute. Each wheel contains a joint motor which is configured so that the body rotates on the spot. Everything is working well, however, there is this slight twitching that occurs every half rotation of the vehicle. Does anyone have any ideas regarding where this twitching could be coming from? Note that the red spheres are just markers and don't have a representation inside of the btMultiBodyDynamicsWorld. One (possibly) important point, the location of the bodies is being rendered via btMultibodyLink::m_cachedWorldTransform, I am not using any motionstates etc.

overhead view


Solution

  • The issue with the model was in fact not due to the physics but to the drawing in OpenGL. For OpenGL, we converted the Quaternion into Euler angles and had a too larger margin for detecting and handling gimbal lock. Reducing this margin significantly improved the visualization.