Closed omershalev closed 1 year ago
Hi @omershalev I haven't really tried that, could you share what exactly is the error? Also why don't you directly use dm_control.viewer ?
Here is the relevant part of the stack trace:
self.scn = mujoco.MjvScene(self.model, maxgeom=10000) TypeError: init(): incompatible constructor arguments. The following argument types are supported:
- mujoco._structs.MjvScene()
- mujoco._structs.MjvScene(model: mujoco._structs.MjModel, maxgeom: int) Invoked with: <dm_control.mujoco.wrapper.core.MjModel object at 0x7fa3dcc9c5d0>; kwargs: maxgeom=10000
I did consider using dm_control.viewer
, but constructing the Environment
object seems like a big hurdle.
I think we can use model.ptr
and data.ptr
:
physics = mujoco.Physics.from_xml_path('my_model.xml')
model = physics.model.ptr
data = physics.data.ptr
viewer = mujoco_viewer.MujocoViewer(model, data)
For me this seems to work fine. Could you please try?
I'll close this issue, but please feel free to reopen if the above solution does not work!
Thank you @rohanpsingh! It worked like a charm.
I'm new to mujoco and I'm trying to play with interactive visualization.
mujoco-python-viewer
seems really useful!I noticed though that I cannot use it with the
dm_control.mujoco.Physics
API (which is more convenient for named indexing, etc.).To clarify my intention, below is an example of the way I would like to use it:
Is there a way to do that?