mujoco-py icon indicating copy to clipboard operation
mujoco-py copied to clipboard

Rendering convex hull

Open btickell opened this issue 6 years ago • 6 comments

The simulate executable for mujoco allows for rendering the convex hull version of the scene which is helpful for analyzing the contact model of certain geoms.

Is it possible to do the same thing in sim.render() or a similar python setting?

btickell avatar Sep 28 '19 02:09 btickell

Is there any update on this? How do we visualize the convex hull in the renderer?

priyankamandikal avatar Dec 14 '19 02:12 priyankamandikal

btickell, were you able to figure out how to render the convex meshes?

priyankamandikal avatar Dec 14 '19 04:12 priyankamandikal

I ended up converting my meshes into convex meshes.

btickell avatar Dec 15 '19 01:12 btickell

Using the HACD library?

priyankamandikal avatar Dec 15 '19 01:12 priyankamandikal

Yes. This seems to be the standard approach from people I've talked to. I think rendering the hull would still be a useful feature.

btickell avatar Dec 28 '19 09:12 btickell

It was late, but I did it like this.

import mujoco_py
from mujoco_py import load_model_from_path, MjSim, MjViewer
import os

mj_path = mujoco_py.utils.discover_mujoco()
xml_path = os.path.join(mj_path, 'model', 'humanoid.xml')

model = load_model_from_path(xml_path)
sim = MjSim(model)
viewer = MjViewer(sim)

viewer.vopt.flags[0] = True
viewer.render()

I found it here.

right-chan avatar Sep 26 '22 14:09 right-chan