Save MuJoCo data state?

Discussion in 'Priority support' started by sc13cs, Jan 19, 2020.

  1. Hi Emo,

    mj_resetData will reset the state of mjData to the default. Is there any efficient way to somehow make mj_resetData to reset the data to a run-time saved state? For example, while the simulation is progressing you want to make mj_resetData to reset data to that specific state?

    The problem I have is that I want to be able to save a run-time state of mjData and reset to that state instead of the initiald/default. Is that possible, or should I manually set desired data from mjData after reset?

  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You should save/restore states manually. mj_resetData always resets to the model defaults. This section of the documentation explains the notion of state:

    Don't save all of mjData, it is too big. Instead save the minimal state as described above, and use mj_forward to recompute the rest of mjData.