Handling constraint "softness".

Post Reply
Dr. DOX
Posts: 14
Joined: Sun Jul 10, 2016 11:51 am

Handling constraint "softness".

Post 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
Attachments
arm.zip
(1.55 MiB) Downloaded 482 times
armsoftness.zip
(376.45 KiB) Downloaded 481 times
Dr. DOX
Posts: 14
Joined: Sun Jul 10, 2016 11:51 am

Re: Handling constraint "softness".

Post by Dr. DOX »

No one suggestion? :(
Jez Hammond
Posts: 7
Joined: Tue Apr 12, 2016 12:53 pm

Re: Handling constraint "softness".

Post 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)
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Handling constraint "softness".

Post 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.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Handling constraint "softness".

Post 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.
Dr. DOX
Posts: 14
Joined: Sun Jul 10, 2016 11:51 am

Re: Handling constraint "softness".

Post 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
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Handling constraint "softness".

Post 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.
Dr. DOX
Posts: 14
Joined: Sun Jul 10, 2016 11:51 am

Re: Handling constraint "softness".

Post 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
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Handling constraint "softness".

Post 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?
Dr. DOX
Posts: 14
Joined: Sun Jul 10, 2016 11:51 am

Re: Handling constraint "softness".

Post 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.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Handling constraint "softness".

Post 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?
Post Reply