robotology / gym-ignition-models

Collection of robot models compatible with gym-ignition
https://github.com/robotology/gym-ignition
GNU Lesser General Public License v3.0
24 stars 7 forks source link

Add restitution coefficient to ground plane #30

Closed diegoferigo closed 3 years ago

diegoferigo commented 3 years ago

Setting the coefficient of the ground to 1.0 does not change the behaviour of the simulation unless the other body in contact has a coefficient different from 0 (the default).

traversaro commented 3 years ago

Setting the coefficient of the ground to 1.0 does not change the behaviour of the simulation unless the other body in contact has a coefficient different from 0 (the default).

Do you have a reference for this? In the SDF docs I only found this docs: http://sdformat.org/spec?ver=1.7&elem=collision#bounce_restitution_coefficient and no info on how the restitution_coefficient is computer for a pair of collision in contact. It would be also useful to know why 1.0 is a good choice.

diegoferigo commented 3 years ago

It is not documented, I got the hint from here, valid also for Gazebo Classic:

True infinite bounce is only achieved if the ground also has the restitution_coefficient set to 1.

I think this approach is similar to what is typically done for mu and mu2. In that case, the ground has typically very high coefficients. If the other body defines mu|mu2, the simulator choses the lower ones.

In this bouncing case, the difference is that there is a [0, 1] range, therefore if the ground has 1 and, by default, the other body has 0, there's no bouncing and the behaviour is what it is expected. I'm not sure, though, how the final coefficient is computed. It could be the multiplication of the two or any other similar operation.

traversaro commented 3 years ago

Thanks, I opened upstream https://github.com/osrf/sdformat/issues/396 to track this.