Visual Geom Meshes

Discussion in 'Visualization' started by Alex Ray, May 8, 2017.

  1. Hi!

    Is it possible to supply a mesh (not currently in assets) for rendering a mesh-type visual geom?

    Thanks,
    ~Alex
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    It has to be declared as an asset, and then the geom has to reference that asset.

    Why would you not want it to be an asset?
     
  3. More explanation on the setup:

    I'm using an HTC Vive to control robots in a simulation, and I'd like to use nice meshes of the controllers/trackers inside the visualization (visual mesh geoms) but not have them affect physics at all.

    To do that, it looks like I'd need to have the mesh assets referenced when the model is built from XML -- but it seems like MuJoCo strips out any unused meshes.

    I'm interested in ways to do this without changing any of the physics of the simulation (like hiding a controller geom in a corner somewhere).
     
  4. Emo Todorov

    Emo Todorov Administrator Staff Member

    You have to reference the mesh asset from some geom, otherwise the model compiler will indeed remove it. But it does not have to affect the physics. You can attach this special geom to a mocap body, and move that body around at runtime, by reading the pose of the Vive controller (see the mjvive.cpp code sample). Set contype=0 and conaffinity=0 for the mesh geom; this will disable all contacts with it. So now you have a mesh geom that is being rendered by MuJoCo but does not interact with the physics.