No contacts between body and height field

Discussion in 'Simulation' started by sytham, Mar 23, 2017.

  1. I have created a height field using a PNG, but the robot I'm simulating is simply moving "through" the height field. I.e., it moves as if on a plane and just goes right through the hills in the height field, instead of being reflected by them or moving over them. The XML is attached.

    Now, I guess one problem could be that currently the model is 2D, i.e. the robot can only move in the plane (through two sliders in x,y and a hinge in z). However, in that case I'd expect the robot to be blocked at the foot of a hill, so before I convert the model to 3D I'd like to know if something else is amiss? And if the problem is indeed the 2D setup, then why isn't the robot blocked by the hills? Thanks.
     

    Attached Files:

  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You have to make sure collisions between the robot and the height field geom are enabled. See documentation about the different ways to control which collisions are enabled.

    Looking at your XML, you have collision="predefined". This means that only explicitly defined geom pairs are checked for collision, and you don't have such pairs. So just delete this attribute and let MuJoCo use the default.
     
  3. Thanks, that works. A side effect was that the robot was unable to move due to friction (strangely enough the frontmost body segment *was* able to move), but I fixed that by setting the ground geom condim=1.