MjSpec.compile()
should populate resulting MjModel
's XML to enable mujoco.mj_saveLastXML
#2075
Labels
enhancement
New feature or request
The feature, motivation and pitch
Currently, the
mj_model
resulting frommj_model = mj_spec.compile()
cannot be saved withmujoco.mj_saveLastXML(mj_model)
because the XML information is not stored in the model. It would be useful to be able to save the XML of anMjModel
without carrying theMjSpec
around.It feels like this would be as simple as storing the
MjSpec.to_xml()
into theMjModel
, but perhaps I'm overlooking something and this is actually more complicated than I think.Alternatives
I can save the compiled model with
mujoco.mj_saveModel
. For debugging purposes, it would be nice to be able to look into the XML. This I can also do by keeping the spec around but it would be more convienient to not have to worry about the spec.Additional context
Here's a simple test case that fails:
Which gives:
The text was updated successfully, but these errors were encountered: