Closed budzianowski closed 5 months ago
That's what keyframes are for, but we should really expose an API function to do what simulate does here...
To be clear this will not change the base configuration, but it will save the state to the model and then after mk_saveXML
it will appear in the XML and you'll be able to reload it.
I tried using the keyframes that you suggested here but I got a problem. If I use it in the same way, I get this error `TypeError: mju_copy(): incompatible function arguments. The following argument types are supported:
I end up with a code (withtout errors) like this:
mujoco.mju_copy(m.key_qpos.T, np.expand_dims(d.qpos, axis=1))
mujoco.mju_copy(m.key_qvel.T, d.qvel)
mujoco.mju_copy(m.key_act.T, d.act)
mujoco.mju_copy(m.key_mpos.T, d.mocap_pos.T)
mujoco.mju_copy(m.key_mquat.T, d.mocap_quat.T)
mujoco.mju_copy(m.key_ctrl.T, d.ctrl)
On top of that, the model m
is not updated, like if the copy did not work.
Note: I am working with the following xml file:
```xml
Is your feature request related to a problem? Please describe. Hey, I'm running the following code:
Describe the solution you'd like I would like to save the new xml with updated body positions (and geoms) after the mj_step.
Describe alternatives you've considered I'm not sure if there is anything smarter right now than to log all the bodies and geoms pos and quat and save it to the xml file?