Home | Tutorials | Wiki | Issues
Ask Your Question

Body falls through the object its placed on, if Kp and Kd parameters are varied.

asked 2014-11-17 19:21:06 -0500

yashc gravatar image

updated 2014-11-17 19:26:46 -0500

Hi Everyone,

I'm not sure if this is an ODE question and if it belongs on this forum, but please do redirect me to the right forum if this is the wrong place for this question.

I was trying to model the interaction between two soft-bodies in Gazebo using the ODE physics simulator. In a simple sense, my model is like a rubber ball placed on a soft-sponge (rectangular in shape).

I was tweaking the Kp and Kd parameters(which are within the ODE tags) of the SDF files of both objects to see if I was able to get the right interaction. When I kept the Kd values very low, the rubber ball would simply fall through the sponge to hit the ground (the sponge is suspended in air ), however, if the Kd is very high, the sponge behaves like a rigid body. How can I allow the ball to sink into the sponge, and yet not fall through the sponge?

Thanks! :)

edit retag flag offensive close merge delete


which Kp and Kd values do you use? t

shpower gravatar imageshpower ( 2014-11-18 07:23:21 -0500 )edit

I've tried a bunch of values, but the ones for which the body falls through are close to: Kp = 50, Kd = 0 (for both bodies). For rigid bodies, Kp = 50000, Kd= 5000.

yashc gravatar imageyashc ( 2014-11-18 08:33:13 -0500 )edit

start from larger values for Kp like 10^7 (you can try even larger) and go lower till you will see a penetration. after that you can add a compatible Kd.

shpower gravatar imageshpower ( 2014-11-18 08:40:45 -0500 )edit

Ok. Will try this. Should I start with zero Kd?

yashc gravatar imageyashc ( 2014-11-18 09:55:54 -0500 )edit

I see you managed to solve this problem. anyway the small Kd such as Kd=1 worked for me.

shpower gravatar imageshpower ( 2014-11-22 06:14:20 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-11-18 07:10:37 -0500

AndreiHaidu gravatar image


you can also play around with the <cfm> and <erp> values for the contact joints. You could try for soft bodies cfm=erp=~1 and kp,kd < 1. I am not sure it will work.

Also take a look at the mud world try running it to see different contact types with the mud objects. This loads the world with the MudPlugin plugin with different parameters for thin mud stiffness = 0.0 and damping = 1.0 for thick stiffness = 0.0 and damping = 10.0.

Here are the stiffness and damping parameters used to compute in the plugin the erp and cfm. However no kp or kd.

Hope this helps, and please update the answer if you manage to figure out how the values are related and what are the actual outcomes.

Cheers, Andrei

edit flag offensive delete link more


Hi Andrei, I thought the Kp, Kd and <erp>, <cfm> values were related and so I wasn't tweaking those. But will try your values now. Will definitely update the thread.

yashc gravatar imageyashc ( 2014-11-18 08:35:24 -0500 )edit

answered 2014-11-21 08:47:57 -0500

yashc gravatar image

So here's how I did it. I used Andrei's values above to create a layer of thick sponge. Then I added a layer of very thin mud on top of this layer.

This allowed my body to fall more evenly into the sponge, without falling through the surface.

edit flag offensive delete link more


Glad it worked, could you kindly post the parameter values as well? It might help people save some time in the future, I know it will help me at one moment :). Thanks!

AndreiHaidu gravatar imageAndreiHaidu ( 2014-11-22 02:49:33 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2014-11-17 19:21:06 -0500

Seen: 1,023 times

Last updated: Nov 21 '14