Height field vs plane

Discussion in 'Modeling' started by sytham, Sep 5, 2017.

  1. Hi,
    I'm simulating robot locomotion (using MuJoCo through OpenAI Gym) and having an issue where I'm seeing a deterioration in locomotion speed when running the robot on a plane versus on a flat height field. All other parameters (robot controller, XML settings etc are the same). I'm loading the height field from PNG.

    I know height field collision detection works somewhat differently from planes, but even when I make a height field that's almost all black, with some white at the edges (i.e. I'd expect elevation to be 0 almost everywhere), I observe this problem. I'd expect that height with elevation 0 almost everywhere should produce the same results as a plane.

    Am I wrong to expect this? Can anything be done to produce the same results?

    Example XMLs are attached (the "hill_" one uses height field). The height field PNG that I tried to use for debugging is also attached.

    Thanks
    Matthijs
     

    Attached Files:

  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Plane and height field collisions are indeed different, even if the height field is perfectly flat. Height fields are always treated as a union of triangular prisms, and each prism is collided using convex collisions. So the number of configuration of contact points will generally be different, in turn resulting in somewhat different contact forces.
     
  3. Thanks. So is there nothing I can do about this? Average speed is more than halved in some cases. It also seems to affect the qualitative behavior (e.g. gait) of the robots.
    The reason I'm asking if something can be done is that I'm testing gait change when terrain switches from flat to rugged. But if the flat part induces a gait that is not the same as the gait on a "real" flat terrain, I'm not comparing what I really want to compare.
     
  4. For example, is it possible to somehow stitch together a plane and a height field in one simulation? Then I could use the plane for the flat part and the height field for the rugged part.
     
  5. Emo Todorov

    Emo Todorov Administrator Staff Member

    Of course, you can do that. You can create any combination of geoms that you want and attach them to any body that you want (in this case the world body).