Page 1 of 1

Constraits to fix the joints

Posted: Mon May 11, 2015 2:09 pm
by CarinaCruz
Hello I'm trying to build a hand with joints using the code below

btGeneric6DofConstraint * joint6DOF;

btTransform indicadorBase, palma;
/* IndicadorBase - Palma */
indicadorBase.getBasis().setEulerZYX(0, SIMD_HALF_PI, 0);
palma.setOrigin(btVector3(5, 22, btScalar(0.)));
joint6DOF = new btGeneric6DofConstraint (*bodyIndicadorBase, *bodyPalma, indicadorBase, palma,useLinearReferenceFrameA);
m_joints[0] = joint6DOF;
m_dynamicsWorld->addConstraint(m_joints[0], false);

but when I move a finger, the three parts that make up this finger, move independently of the movement. There is a way to fix these joints for moving together? Or I am using the wrong constraint?

Thanks!

Re: Constraits to fix the joints

Posted: Mon May 11, 2015 4:20 pm
by Erwin Coumans
By default, all constraints are free in the 6dof constraint.

setAngularLowerLimit(btVector3(0,0,0));
setAngularUpperLimit(btVector3(0,0,0));
setLinearLowerLimit(btVector3(0,0,0));
setLinearUpperLimit(btVector3(0,0,0));

You can also use the btFixedConstraint instead. It is derived from :btGeneric6DofSpring2Constraint
(note the 'Spring2' part, this constraint will replace btGeneric6DofConstraint.
(assuming you are using Bullet 2.83 or later)

Re: Constraits to fix the joints

Posted: Mon May 11, 2015 5:24 pm
by CarinaCruz
Hi Erwin! Thansk for the answer!

Changing the code to add what you pointed me I got the error: MyApp.exe has triggered a breakpoint in line btAssert(fsum > SIMD_EPSILON); of btSequentialImpulseConstraintSolver... The same error i got with other attempts to constraints...


Why this error happens?

Thak you very much

Re: Constraits to fix the joints

Posted: Wed May 13, 2015 8:16 am
by Basroil
Sounds like your joint is exploding, either bodies attached to it are too different (100000:1 ratio), you have dynamic redundancy (closed chains), or some settings that don't work well with your solver parameters. Are you having the fingers press up against each other?

As for hand joints, fingers are for the most part 1DoF hinge joints (even the thumb, since the axis of rotation is slightly offset), and it's usually easier to use hinge joints than 6dof.

Re: Constraits to fix the joints

Posted: Wed May 13, 2015 11:39 pm
by Erwin Coumans
CarinaCruz wrote: Changing the code to add what you pointed me I got the error: MyApp.exe has triggered a breakpoint in line btAssert(fsum > SIMD_EPSILON); of btSequentialImpulseConstraintSolver... The same error i got with other attempts to constraints...
Please re-create the issue by modifying one of the Bullet examples, such as the Bullet/examples/Constraints/ConstraintDemo or Bullet/examples/Constraints/Dof6Spring2Setup.cpp
Then you can attached the zipped source file to this forum topic, hopefully someone can look at it.
Thanks,
Erwin

Re: Constraits to fix the joints

Posted: Tue May 19, 2015 8:26 pm
by CarinaCruz
Hi Basroil

For every constraint different of 6DOF this error happens...

Its so very strange....

Thanks for the answers!


Erwin i'll do this!
Thanks!

Re: Constraits to fix the joints

Posted: Tue Jul 07, 2015 2:09 pm
by CarinaCruz
I managed to create together with btHingeConstraint,but the joints are rotating all the time (as shown in Figure 1). And when I add rotation values on the fingers (with data received from a data glove) parts of the fingers come off the hand and go "flying" the environment (as shown in Figure 2).

This is an example of the joints implementation:

Code: Select all

 indicadorBase.getBasis().setEulerZYX(0, SIMD_HALF_PI, 0);
	palma.setOrigin(btVector3(5, 22, btScalar(0.)));
	hingeC = new btHingeConstraint(*m_bodies[INDICADOR_BASE], *m_bodies[PALMA], indicadorBase, palma);
	m_joints[JOINT_PALMA_INDICADOR] = hingeC;
	m_dynamicsWorld->addConstraint(m_joints[JOINT_PALMA_INDICADOR], true);
 
Anyone can help me with this?