hx_collision

Discussion in 'MuJoCo HAPTIX Feature Requests' started by David Kluger, Mar 16, 2015.

  1. We have a feature request for a new MATLAB function to include in the API. Please let me know if adding this function is feasible.

    Function syntax: boolean = hx_collision(object1,object2)
    Where object1 and object2 are strings denoting an object name (which would be defined in the .xml file MuJoCo is running to generate the simulation)
    The boolean returned is 1 if object1 and object2 are in contact with one another and 0 otherwise.
    Ideally, the argument object1 could be a list of strings, so hx_collision could detect if a group of environment objects defined in object1 is/are contacting object2, and return a list of booleans appropriately which has a length matching the number of objects defined in the object1 list.

    This function has the potential to be very useful for human experiments where we must time certain tasks, like how long it takes to pick up and move an object to a target in the VRE, for example.
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    hx_collision is a good idea, although it is not clear how exactly it should work. One may want more than a Boolean indicating presence or absence of contact. For example, it may be useful to have contact distance (or penetration), contact normal and tangential force, relative velocity in contact space, orientation of the contact normal in the world frame (so that you can tell if object A is on top of object B or the other way around).

    One option we are considering as part of the future "world API" is to return the complete list of active contacts, where each record indicates the two bodies that are in contact and contains the rest of the contact-related data available to the simulator. User-side code can then filter this list as desired. Would people find this useful, or is it overkill?

    In general, suggestions about extending the API are very welcome. There is a plan to do it, but it would be better if we did it based on user feedback.
     
  3. I like this idea and believe it would be useful as long as implementation of this feature does not slow down the API or the VRE update rate.