Framepos and Touch sensor

Discussion in 'Modeling' started by Edward Fang, Jun 21, 2017.

  1. 1. I am trying to extract the position of a 'site' defined in an asset xml file. It seems like the correct way to do this would be to use a framepos sensor. However, I am constrained to use MuJoCo 1.31 due to its integration with MuJoCo-Py. It seems framepos is not supported by this version. Is there a work around for being able to detect the spatial position of a site?

    2. Is the touch sensor object supposed to detect if any geom goes into the volume defined by a linked site, or are there only specific objects that would trigger it?
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Site positions and orientations in the world frame are in mjData.site_xpos and xmat. You can access them directly, without defining corresponding sensors.

    The touch sensor detects contacts on the geoms of the body where the site is attached (sites do not participate in collision detection). If the contact point is inside the sensor zone, or the contact force points towards the sensor zone, the contact normal force is added to the sensor output. Note that this mechanism was somewhat heuristic in MuJoCo 1.31, and works better in 1.50 using the new ray intersection. Contacts are now included in the sensor output whenever the ray defined by the contact force intersects the touch sensor zone.