saving and loading

Discussion in 'Modeling' started by Ana_Ha, Jun 1, 2017.

  1. hi emo,

    what is the best way to save all data including the environment throughout an experiment?
    We would also like to be able to re-load the saved data in order to do post processing analysis
    could you advise?
    (using mujoco with Vive)
    thanks
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You could save the entire mjData, but it is quite big. If you choose that route, note that mjData.buffer is a buffer with all the real-valued data, and the rest are pointers within that buffer.

    It is better to decide in advance which fields you want to save, and write only those fields to a file, after each simulation step. Keep in mind that if you have the state and control, and then call mj_forward, it will reconstruct the rest of mjData. See this section in the documentation:

    http://www.mujoco.org/book/programming.html#siStateControl
     
  3. Thank you for the advise.