I am using Bullet for a robot simulator and I am trying to get the generic 6DOF joint working by using a Blender Collada export which I reimport using our own tools and create the Bullet world.
I have two rigid bodies, one is static and has 0 mass and the other is dynamic and has mass 1kg. The two are connected using the constraint.
Code: Select all
<rigid_body name="r_upper_arm-RigidBody" sid="r_upper_arm-RigidBody">
<technique_common>
<dynamic>false</dynamic>
<mass>0</mass>
<instance_physics_material url="#r_upper_arm-PhysicsMaterial"/>
<shape>
<instance_geometry url="#r_upper_arm-Geometry"/>
</shape>
</technique_common>
</rigid_body>
<rigid_body name="r_lower_arm-RigidBody" sid="r_lower_arm-RigidBody">
<technique_common>
<dynamic>true</dynamic>
<mass>1.0</mass>
<instance_physics_material url="#r_lower_arm-PhysicsMaterial"/>
<shape>
<instance_geometry url="#r_lower_arm_004"/>
</shape>
</technique_common>
</rigid_body>
<rigid_constraint name="Const" sid="Const">
<ref_attachment rigid_body="r_upper_arm-RigidBody">
<translate>0.00000 0.00000 -1.05833</translate>
<rotate>1 0 0 0.00000</rotate>
<rotate>0 1 0 -0.00000</rotate>
<rotate>0 0 1 90.00000</rotate>
</ref_attachment>
<attachment rigid_body="r_lower_arm-RigidBody">
<translate>0.00000 0.00000 1.02500</translate>
<rotate>1 0 0 0.00000</rotate>
<rotate>0 1 0 0.00000</rotate>
<rotate>0 0 1 90.00000</rotate>
</attachment>
<technique_common>
<enabled>true</enabled>
<limits>
<linear>
<min>0 0 0</min>
<max>0 0 0</max>
</linear>
<swing_cone_and_twist>
<min>0 0 0</min>
<max>0 0 0</max>
</swing_cone_and_twist>
</limits>
</technique_common>
</rigid_constraint>
Code: Select all
btVector3 iMJlA = solverConstraint.m_contactNormal*rbA.getInvMass();
btVector3 iMJaA = rbA.getInvInertiaTensorWorld()*solverConstraint.m_relpos1CrossNormal;
btVector3 iMJlB = solverConstraint.m_contactNormal*rbB.getInvMass();//sign of normal?
btVector3 iMJaB = rbB.getInvInertiaTensorWorld()*solverConstraint.m_relpos2CrossNormal;
btScalar sum = iMJlA.dot(solverConstraint.m_contactNormal);
sum += iMJaA.dot(solverConstraint.m_relpos1CrossNormal);
sum += iMJlB.dot(solverConstraint.m_contactNormal);
sum += iMJaB.dot(solverConstraint.m_relpos2CrossNormal);
solverConstraint.m_jacDiagABInv = btScalar(1.)/sum;
Could this be a Bullet problem or a problem in our code. Maybe someone could give me a hint to speed up the debugging process.
Thanks a lot.
Cheers