google / brax

Massively parallel rigidbody physics simulation on accelerator hardware.
Apache License 2.0
2.23k stars 246 forks source link

Weird simulation interactions when the frozen floor body does not have the mass property set #117

Open benelot opened 2 years ago

benelot commented 2 years ago

While developing the swimmer env, I realized that the mass property of the floor body is really important, even though it is frozen and thus is acting like something with infinite mass. First of all, I found the first body of the swimmer to be slightly overlapping with the floor, then later as I applied a random action to see if the swimmer works correctly, its body parts moved around randomly. Adding mass: 1 resolves the issue completely.

So my question is: Does the mass property in frozen: all bodies make sense somehow and if not set, should it be set to a default value to avoid simulation issues?

erikfrey commented 2 years ago

Great find. I agree mass on a frozen body should not matter. We will have a look.

cdfreeman-google commented 2 years ago

Hey Benjamin! I don't suppose you happen to have a repro for this, do you?

benelot commented 1 year ago

I would assume you could remove the mass property from the body in the swimmer env colab and see if it still persists. In the pusher env, I saw that it just throws out some division by zero mass into the console if the property is not set. I do not have a direct repro for this, sorry. It happened when the frozen floor body does not have the mass property set (as generated by the mujoco converter).

On Mon, Mar 28, 2022 at 10:56 PM Daniel Freeman @.***> wrote:

Hey Benjamin! I don't suppose you happen to have a repro for this, do you?

— Reply to this email directly, view it on GitHub https://github.com/google/brax/issues/117#issuecomment-1081135249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXXXKYIOQAAM5D7XDE64ITVCIMH7ANCNFSM5IL4CGUQ . You are receiving this because you authored the thread.Message ID: @.***>