Page 1 of 1

Handling constraint "softness".

Posted: Fri Nov 11, 2016 6:13 pm
by Dr. DOX
Hi

I've made an example of a simple robotic arm. This works fine but I can see That the constraints points are too "soft". Can we make those as totally rigid? I'm using various constraint types: hinge, 6DOF, twist, slider. In general I've seen That constraint's chain to becomes "soft" during movement allowing a sort of bumpiness of various chain elements. Playing with mass and velocity we can reduce this behavior but I need a totally rigid reaction.
I've attached a little video (armsoftness.zip) That shows this point. The robot hand bends under the force, but I want it totally rigid.
In general, the overall movement (arm.zip) have some "elastic reaction" when a stop comes.

Many thanks. Bye

Re: Handling constraint "softness".

Posted: Sat Nov 12, 2016 11:39 pm
by Dr. DOX
No one suggestion? :(

Re: Handling constraint "softness".

Posted: Mon Nov 14, 2016 10:41 am
by Jez Hammond
Try (for example) the btNNCGConstraintSolver, it solidly solves all sorts of contraptions.

*though I'm recently trying to get 'rolling friction' to work again, but iirc something was conflicting with the above solver :/ (settling for no rolling friction here)

Re: Handling constraint "softness".

Posted: Mon Nov 14, 2016 10:48 pm
by benelot
You could change the erp/cfm values to change the joint softness. This can be done on a per solver or a per joint basis. Here is an ERP/CFM helper I wrote, which explains what the two values do and how they can be influenced. You can copy the code directly into your code to change the softness with the more intuitive spring and damping constants.

Re: Handling constraint "softness".

Posted: Tue Nov 15, 2016 2:09 am
by Erwin Coumans
Dr. DOX wrote:I've made an example of a simple robotic arm. This works fine but I can see That the constraints points are too "soft". Can we make those as totally rigid?
Yes, you should use btMultiBody. Download the very latest Bullet version and have a play with the ExampleBrowser, it can load robot descriptions from URDF and SDF files, to make it easier to create btMultiBody.

Re: Handling constraint "softness".

Posted: Tue Nov 15, 2016 1:34 pm
by Dr. DOX
Thanks you for all suggestions. I'll look at new bullet and erp/cfm. benelot, where is the erp/cfm helpr as you said?

Many thanks, bye

Re: Handling constraint "softness".

Posted: Thu Nov 17, 2016 10:36 pm
by benelot
Sorry, it somehow much have gotten out of the post:
https://github.com/bulletphysics/bullet ... Helper.hpp

But as Erwin said, maybe the Multibody is the way to go here, especially because for robotarms you can easily write a urdf file and load it. You can get beautiful robot simulations with it.

Re: Handling constraint "softness".

Posted: Thu Nov 24, 2016 2:53 pm
by Dr. DOX
Hi benelot. Thank you. In general, if I well understand, to obtain a totally rigid reaction should be sufficient set the CFM value on constraint, calling something like this:

hinge->setParam(BT_CONSTRAINT_CFM, 0);
hinge->setParam(BT_CONSTRAINT_STOP_CFM, 0);

...but the behaviour seems the same to me. Calling or not the setParame the "sponginess" is there...Should be used with a specific solver? I'll surely look at multiBody but this point is still important to understand the engine reaction in various situations.

Thanks, bye

Re: Handling constraint "softness".

Posted: Sat Nov 26, 2016 9:00 am
by benelot
I did not know about the sponginess param, but the cfm and erp should fix your issue. What solver and options are you using now?

Re: Handling constraint "softness".

Posted: Sat Nov 26, 2016 10:31 pm
by Dr. DOX
benelot wrote:I did not know about the sponginess param, but the cfm and erp should fix your issue. What solver and options are you using now?
Hi. Now I'm using the btImpulseConstraintSolver and a lot of btHingeConstraint. To any btHingeConstraint I've setted the CFM paramater like that:

hinge->setParam(BT_CONSTRAINT_STOP_CFM, 0);
hinge->setParam(BT_CONSTRAINT_CFM, 0);

....but the hinge stay "soft", when the structure collide with an object, the constraint bends on the force. The behaviour is the same like first video I've posted, seems there is no change using or not the CFM parameter. Hummm......

Thanks.

Re: Handling constraint "softness".

Posted: Mon Nov 28, 2016 8:51 pm
by benelot
You could use the helper class I suggested and you should especially set the ERP. That tunes the amount of error that is reduced every time step. Can you give us a video of what is happening?