google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
7.47k stars 734 forks source link

Query on viewer/render/read_pixels API migration to Mujoco 3.x #1738

Closed girishsmurthyIntel closed 6 days ago

girishsmurthyIntel commented 1 week ago

Dear Team,

    I was unable to understand how to map mujoco2.x APIs **mujoco_py.MjViewerBasic**, corresponding **render and read_pixels** APIs in mujoco 3.0. Request your kind help on this.
girishsmurthyIntel commented 1 week ago

I used the API mujoco.viewer.launch_passive(self.conveyor.model, self.conveyor.data, show_left_ui= False, show_right_ui= False), but I get the error: ERROR: mjv_makeSceneState: mjvSceneState buffer is not fully used

Press Enter to exit ..

Please advise.

girishsmurthyIntel commented 1 week ago

@yuvaltassa Can you kindly help here.

yuvaltassa commented 1 week ago

We cannot help you without a minimal reproducible example.

girishsmurthyIntel commented 1 week ago

Hi @yuvaltassa, Please find the model attached. The main xml file is warehouse_v2.xml The segments of the code I have used are self.model = mujoco.MjModel.from_xml_path(fullpath) # fullpath is the path for the file warehouse_v2.xml self.data = mujoco.MjData(self.model) mujoco.mj_forward(self.model, self.data) mujoco.viewer.launch_passive(self.model, self.data, show_left_ui= False, show_right_ui= False) assets.zip

girishsmurthyIntel commented 6 days ago

Dear @yuvaltassa, Can you kindly check this xml file and help us know of this error.

girishsmurthyIntel commented 6 days ago

Hi @yuvaltassa , I figured out that if I remove the from the xml file, the error doesn't occur. Kindly provide your insights.

yuvaltassa commented 6 days ago

I don't know what it means to "remove the from". No insights from me.

girishsmurthyIntel commented 6 days ago

Hi @yuvaltassa , I am so sorry, the comment isn't rightly uploaded. I figured out that if I remove the line below in the warehouse_v2.xml file, the error doesn't occur. kindly provide your insights njmax="10000" nconmax="10000"

yuvaltassa commented 6 days ago

We have documentation, please read it. Specifically take note of the word legacy

https://mujoco.readthedocs.io/en/latest/modeling.html#csize

https://mujoco.readthedocs.io/en/latest/XMLreference.html#size-memory