Mujoco viewer maintained by K-Scale Labs.
Originally referenced from mujoco-python-viewer.
pip install kmv
Run the humanoid example script to see the viewer in action:
# cd to the root of the repo
python examples/default_humanoid.py
import mujoco
from kmv.viewer import launch_passive
# Load model and create data
model = mujoco.MjModel.from_xml_path("path/to/model.xml")
data = mujoco.MjData(model)
# Run viewer
with launch_passive(model, data, make_plots=True) as viewer:
# Setup camera and other options if needed
viewer.setup_camera(render_distance=4.0, render_lookat=[0.0, 0.0, 1.0])
while running_simulation:
# Update physics
mujoco.mj_step(model, data)
# Update visualization
viewer.update_and_sync()