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

Getting/Setting the state of the simulation #1735

Closed girishsmurthyIntel closed 1 week ago

girishsmurthyIntel commented 1 week ago

Dear Team,

   To replace the get_state & set_state APIs in mujoco 2,  mujoco 3.0 would use the mj_getState or the mj_setState APIs. 

I need help to understand what the third argument of mj_getState or the mj_setState APIs i.e, *"mjtNum state"** refers to? Also what should I initialize this argument at the beginning, while running a getState? Any references will be helpful.

Rgds, Girish

yuvaltassa commented 1 week ago

Are you using Python or C++?

yuvaltassa commented 1 week ago

I seem to remember you use Python?

Anyway, please read the documentation here and the test code here and/or here.