Skip to content

erez-tom/pymujoco

 
 

Repository files navigation

pymujoco Software License

pymujoco-python bindings for MuJoCo simulator generated using pybind11.

There is also a preliminary colab that allows headless rendering using EGL (cannot restart the EGL context at the moment).

Usage

from pymujoco import *
r = mjv_create_renderer()

#help(p)
m = mj_loadXML("humanoid.xml")
#print(m.qpos0)
#print(m.nq)
#print(m.nv)
d = mj_makeData(m)

exit_requested=False
while not exit_requested:
  mj_step(m,d)
  
  print(d.qpos)
  exit_requested = r.render(m,d)
  
names = ''.join([row.tostring().decode('UTF-8') for row in m.names]).split('\x00')
print("names=",names)
mj_printModel(m, "humanoid2.txt")
mj_deleteData(d)
mj_deleteModel(m)

mjv_delete_renderer(r)

About

Python bindings for open source MuJoCo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 60.8%
  • C++ 37.8%
  • Python 1.4%