You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In robosuite/models/base.py, why does the get_model() function use StringIO? Can't load_model_from_xml directly take a string? The current way appears to create a new .xml file under /tmp/ every time it is called.
def get_model(self, mode="mujoco_py"):
"""
Returns a MjModel instance from the current xml tree.
"""
available_modes = ["mujoco_py"]
with io.StringIO() as string:
string.write(ET.tostring(self.root, encoding="unicode"))
if mode == "mujoco_py":
from mujoco_py import load_model_from_xml
model = load_model_from_xml(string.getvalue())
return model
raise ValueError(
"Unkown model mode: {}. Available options are: {}".format(
mode, ",".join(available_modes)
)
)
The text was updated successfully, but these errors were encountered:
In robosuite/models/base.py, why does the
get_model()
function use StringIO? Can'tload_model_from_xml
directly take a string? The current way appears to create a new .xml file under /tmp/ every time it is called.The text was updated successfully, but these errors were encountered: