Skip to content

Repository files navigation

The Mechcat Mujoco viewer

This library is a WebGL renderer for mujoco that is baed on mechcat-python and the mjcf_viewer packages on git.

To install you must have the following dependencies

pip install dm_control
pip install meshcat

once these packages are successfully installed, clone this package directory and install it via pip

pip install -e . 

This will install the package as an importable python library

How to use

You must first have an instantiated mujoco MjModel and MjData class

import mujoco 
from meshcat_mujoco import MeshCatVisualizer

xml_path = './a1/xml/a1/a1.xml'
model   = mujoco.MjModel.from_xml_path(xml_path)
data    = mujoco.MjData(model)


viewer = MeshCatVisualizer(xml_path, model, data)

i = 0 # <-- counter 
for _ in range(10000): 

    # use mujoco as normal with stepping function 
    mujoco.mj_step(model, data)
    # make sure you call the render function 
    viewer.render()

viewer.close()
# close

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages