Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignition gazebo is not simulating the dynamics(stiffness, damping, etc.) correctly #1961

Open
xibeisiber opened this issue Apr 10, 2023 · 7 comments
Labels
bug Something isn't working help wanted We accept pull requests!

Comments

@xibeisiber
Copy link

xibeisiber commented Apr 10, 2023

Environment

  • OS Version: Ubuntu 22.04,
  • Source or binary build?
    binary: ignition gazebo (Fortess) 6.11.0, gazebo 11.10.2.

Description

in the sdf, there are two boxes. I changed the contact attribute as follows:

             <contact>
              <ode>
                <min_depth>0.3</min_depth>
                <kp>1e+03</kp>
                <kd>0</kd>
                <max_vel>100</max_vel>
              </ode>
            </contact>
  • Expected behavior:
    there will be some bouncing and penetration when the small box falls upon the bigger one.
  • Actual behavior:
    the bouncing and penetration appears in class gazebo 11.10.2, but not in ignition gazebo (Fortess) 6.11.0

Steps to reproduce

load the sdf (file link) by:
ign gazebo t.sdf (video link)
gazebo t.sdf (video link)

@xibeisiber xibeisiber added the bug Something isn't working label Apr 10, 2023
@xibeisiber xibeisiber changed the title ignition gazebo is not simulating the dynamics correctly ignition gazebo is not simulating the dynamics(stiffness, damping, etc.) correctly Apr 10, 2023
@azeey azeey added the help wanted We accept pull requests! label Apr 10, 2023
@azeey azeey self-assigned this Apr 10, 2023
@azeey
Copy link
Contributor

azeey commented Apr 11, 2023

Gazebo classic uses the ODE physics engine by default whereas the new Gazebo uses DART. The parameters you mentioned are not supported in DART, AFAIK, so I don't know if it can be fixed. We definitely need to document that they are not supported though.

@xibeisiber
Copy link
Author

xibeisiber commented Apr 12, 2023

Gazebo classic uses the ODE physics engine by default whereas the new Gazebo uses DART. The parameters you mentioned are not supported in DART, AFAIK, so I don't know if it can be fixed. We definitely need to document that they are not supported though.

Thanks. I add the following to t.sdf (I suppose this will let ignition gazebo use ODE?), but nothing changed.

    <physics name="1ms" type="ode">
      <max_step_size>0.001</max_step_size>
      <real_time_factor>1.0</real_time_factor>
    </physics>

Also, I use "dart/soft_contact" tag in t_dart.sdf following the instruction in http://sdformat.org/spec?ver=1.6&elem=collision#surface_soft_contact. But no bouncing behavior appears.

@azeey
Copy link
Contributor

azeey commented Apr 12, 2023

The new Gazebo does not support ODE at all, so your change won't enable ODE. If you're interested only in bouncing dynamics, you'll want to set the restitution_coefficient (http://sdformat.org/spec?ver=1.6&elem=collision#bounce_restitution_coefficient)

@xibeisiber
Copy link
Author

The new Gazebo does not support ODE at all, so your change won't enable ODE. If you're interested only in bouncing dynamics, you'll want to set the restitution_coefficient (http://sdformat.org/spec?ver=1.6&elem=collision#bounce_restitution_coefficient)

I am simulating the hybrid force/position control and want the object surface to be less stiff (like a spring) so that the contact force will not be too large.

I'm not sure whether adjusting the restitution_coefficient will produce moderate contact force (will try later).

Since ignition gazebo is using DART, I use the "soft_contact" tag and set the "stiffness" and "damping" tag in t_dart.sdf following the instruction in http://sdformat.org/spec?ver=1.6&elem=collision#surface_soft_contact. Why these two parameters still do not work?

@Mads-MA
Copy link

Mads-MA commented Apr 17, 2023

I am simulating the hybrid force/position control and want the object surface to be less stiff (like a spring) so that the contact force will not be too large.

I have been looking into this since I need to do something similar to the quote above.
AFAIK, SDFormat does not parse or even attempt to read the soft_contact element. Furthermore, gz-physics does not use the soft_contact either.

I attempted to add support for soft contact/soft body myself.
However, even though my addition to SDFormat seems to parse the soft_contact element correctly, gz-physics does not. I will gladly do a pull request once it is done, if someone is willing to help/guide me a bit.

@xibeisiber
Copy link
Author

Is there any progress or schedule on this?

@azeey
Copy link
Contributor

azeey commented May 1, 2023

Since ignition gazebo is using DART, I use the "soft_contact" tag and set the "stiffness" and "damping" tag in t_dart.sdf following the instruction in http://sdformat.org/spec?ver=1.6&elem=collision#surface_soft_contact. Why these two parameters still do not work?

There's an open issue (gazebosim/gz-physics#222) for this, but there hasn't been any progress. There's also a related issue (gazebosim/gz-physics#44) for bullet. If you are interested in contributing, there's some guidance here

Is there any progress or schedule on this?

This is not currently on our roadmap, but we'd be glad to review contributions from the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted We accept pull requests!
Projects
Status: To do
Development

No branches or pull requests

3 participants