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
Hi, I'm a student and I'm trying to use MuJoCo for simulating rigid body dynamics.
I'm looking for some help with setting "user" attribute in "body" elements in .XML files. Reading this section and referring to these lines, I tried to set a user parameter as follows:
Traceback (most recent call last):
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/parser.py", line 210, in _parse_children
mjcf_child = mjcf_element.add(xml_child.tag, **attributes)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 630, in add
return self.insert(element_name, position=None, **kwargs)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 655, in insert
new_element = _make_element(child_spec, self, attributes=kwargs)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 128, in _make_element
return _ElementImpl(spec, parent, attributes)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 185, in __init__
self._check_valid_attribute(attribute_name)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 534, in _check_valid_attribute
raise AttributeError(
AttributeError: 'user' is not a valid attribute for <body>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/parser.py", line 104, in from_path
return _parse(xml_root, escape_separators,
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/parser.py", line 169, in _parse
_parse_children(xml_root, mjcf_root, escape_separators)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/parser.py", line 219, in _parse_children
_parse_children(xml_child, mjcf_child, escape_separators)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/parser.py", line 216, in _parse_children
raise err_type(
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/parser.py", line 210, in _parse_children
mjcf_child = mjcf_element.add(xml_child.tag, **attributes)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 630, in add
return self.insert(element_name, position=None, **kwargs)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 655, in insert
new_element = _make_element(child_spec, self, attributes=kwargs)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 128, in _make_element
return _ElementImpl(spec, parent, attributes)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 185, in __init__
self._check_valid_attribute(attribute_name)
File "/home/atsushi/miniconda3/envs/rigid_body_manip_se3/lib/python3.9/site-packages/dm_control/mjcf/element.py", line 534, in _check_valid_attribute
raise AttributeError(
AttributeError: Line 4: error while parsing element <body>: 'user' is not a valid attribute for <body>
Does mjcf support .XML files with "body" elements with a "user" parameter in the first place? If it supports, which part should I change in the XML string above?
Thanks in advance,
The text was updated successfully, but these errors were encountered:
Hey, I am a student as well not an expert. I have a similar problem just like you in Issue #457. I have not received any answers yet. But I solved it pretty unprofessionally, it worked tho. Something like this:
xml = env_mjcf.to_xml_string()
xml = xml.replace("<flexcomp ", '<flexcomp dim="3"', 1)
model = mujoco.MjModel.from_xml_string(xml)
On the github version mjcf/schema.xml they are not defined as valid attributes. After manually added the dim attribute to the flexcomp element, it solved my issue.
Hi, I'm a student and I'm trying to use MuJoCo for simulating rigid body dynamics.
I'm looking for some help with setting "user" attribute in "body" elements in .XML files. Reading this section and referring to these lines, I tried to set a user parameter as follows:
But I got the following error:
Does
mjcf
support .XML files with "body" elements with a "user" parameter in the first place? If it supports, which part should I change in the XML string above?Thanks in advance,
The text was updated successfully, but these errors were encountered: