Skip to content

Weird collision behaviors between hfield and sphere (and maybe other geoms) #2883

@chengruiz

Description

@chengruiz

Intro

Hi!

I am a PhD student at Zhejiang University. I use MuJoCo for my research on legged locomotion.

I am testing bouncing behaviors with MuJoCo. I found that sometimes the sphere gets sucked into the hfield, especially when the sphere is small (e.g. 0.02), has a large timeconst (e.g. 0.04) or a large velocity (e.g. 3m/s).

For example, this model produces the sucking behavior:

<mujoco model="hfield_sphere_h0.5">
  <option timestep=".001"/>
  <asset>
    <hfield name="hf" nrow="10" ncol="10" size="1 1 0.1 0.1"/>
  </asset>

  <worldbody>
    <geom type="hfield" hfield="hf"/>
    <body>
      <freejoint/>
      <geom pos="0 0 0.5" size="0.02 0.02 0.02" type="sphere"/>
    </body>
  </worldbody>
</mujoco>
suck-2025-09-29_16.48.55.mp4

This model behaves normally:

<mujoco model="hfield_sphere_h0.3">
  <option timestep=".001"/>
  <asset>
    <hfield name="hf" nrow="10" ncol="10" size="1 1 0.1 0.1"/>
  </asset>

  <worldbody>
    <geom type="hfield" hfield="hf"/>
    <body>
      <freejoint/>
      <geom pos="0 0 0.3" size="0.02 0.02 0.02" type="sphere"/>
    </body>
  </worldbody>
</mujoco>
no-suck-2025-09-29_16.49.32.mp4

After setting timeconst to 0.04, the model also produces the sucking behavior.

<mujoco model="hfield_sphere_h0.3_timeconst0.04">
  <option timestep=".001"/>
  <asset>
    <hfield name="hf" nrow="10" ncol="10" size="1 1 0.1 0.1"/>
  </asset>

  <worldbody>
    <geom type="hfield" hfield="hf"/>
    <body>
      <freejoint/>
      <geom pos="0 0 0.3" size="0.02 0.02 0.02" type="sphere" solref="0.04 1.0"/>
    </body>
  </worldbody>
</mujoco>
suck2-2025-09-29_16.50.01.mp4

Decreasing the timestep to 1e-5 does not improve the issue.

Changing the hfield to plane definitely solves the issue.

My setup

MuJoCo C 3.3.6

What's happening? What did you expect?

The bouncing issue. Expected to be the same as that of a plane.

Steps for reproduction

Use simulate to run the above models.

Minimal model for reproduction

No response

Code required for reproduction

No response

Confirmations

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions