constraints aren't stiff

Post Reply
Otz
Posts: 8
Joined: Wed Jun 27, 2012 9:13 am

constraints aren't stiff

Post by Otz »

Hi,

at the moment I develop a simulation for a humanoid robot, but i have a problem with the constraints.
I use the btGeneric6DofConstraint for all joints of my robot an set angular and linear Limits 0.
I set the CFM- and ERP-parameter with follow values:

linearStopERP = 0.6
linearStopCFM = 0.9
linearCFM = 0.9
angularStopERP = 0.6
angularStopCFM = 0.9
angularCFM = 0.9

Unfortunately, the joints bounce when the robot walk or hit on the ground. I tried to test some ERP-CFM-Configurations without a success. There are some pictures of my problem at the attachment and here a little demo video :
http://www.youtube.com/watch?v=aPJdQCXqWeU

Here some Code:

Code: Select all

btGeneric6DofConstraint * Robot::addbtGeneric6DofSpringConstraint (RobotPart *partA, RobotPart *partB,btVector3 pointInA,btVector3 pointInB, bool useLinearReferenceFrameA){

	pointInA.setValue((btScalar)pointInA.x()*(btScalar)scale.x(),(btScalar)pointInA.y()*(btScalar)scale.y(),(btScalar)pointInA.z()*(btScalar)scale.z());
	pointInB.setValue((btScalar)pointInB.x()*(btScalar)scale.x(),(btScalar)pointInB.y()*(btScalar)scale.y(),(btScalar)pointInB.z()*(btScalar)scale.z());

	btTransform tInA;
	tInA.setIdentity();
	tInA.setOrigin( pointInA );
	btTransform tInB;
	tInB.setIdentity();
	tInB.setOrigin( pointInB );
	btGeneric6DofConstraint *cons = new btGeneric6DofSpringConstraint(*partA->getRigidBody(),*partB->getRigidBody(),tInA,tInB,false);


	partA->getRigidBody()->setActivationState(DISABLE_DEACTIVATION);
	partB->getRigidBody()->setActivationState(DISABLE_DEACTIVATION);


	cons->setAngularLowerLimit(btVector3(0,0,0));
	cons->setLinearLowerLimit(btVector3(0,0,0));
	cons->setAngularUpperLimit(btVector3(0,0,0));
	cons->setLinearLowerLimit(btVector3(0,0,0));


	dynamicsWorld->addConstraint(cons); 

	allConstraints.push_back(cons);

	return cons;
}
I hope you can help me with my problem

Thanks,
Oliver
Attachments
constraint-problem.zip
some pictures of my problem
(130.7 KiB) Downloaded 280 times
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: constraints aren't stiff

Post by Dirk Gregorius »

Use 0.1 - 0.2 for ERP and 0.0 for CFM. You are essentially making the joints soft. Look here for an explanation: http://ode.org/ode-latest-userguide.html#sec_3_7_0
Otz
Posts: 8
Joined: Wed Jun 27, 2012 9:13 am

Re: constraints aren't stiff

Post by Otz »

Hey,

i have fixed some stupid bugs in my simulator, but the constraints still aren't stiff.
Here a little video: http://www.youtube.com/watch?v=R6KRtTQf874

my parameters:

linStopERP 0.4
linStopCFM 0.0000
linCFM 0.0000
angStopERP 0.4
angStopCFM 0.0000
angCFM 0.0000

Can somebody help me with this problem?

A further helpfully information:

Linked objects can collide with each other in my implementation:

Code: Select all

dynamicsWorld->addConstraint(cons,true);
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: constraints aren't stiff

Post by Dirk Gregorius »

You can ramp up the iteration count and also use smaller timesteps. Make sure you enable warmstarting and there is a warmstarting factor which defaults to 0.9 iirc. Make sure it is set to 1.0
Otz
Posts: 8
Joined: Wed Jun 27, 2012 9:13 am

Re: constraints aren't stiff

Post by Otz »

thank you for the tipps!!
Post Reply