-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize a flexcomp object in PyMJCF #445
Comments
I am having a similar issue trying to load a flexcomp object with dm_control PyMJCF. I have this xml file with my flexcomp object taken from here. <mujoco model="Flag">
<!-- Degree of Freedom (nv): 340
Tendons (ntendon): 288
Actuators (nu): 0
Constraints (nefc): 0
This model of a flag passively flapping in the wind has no constraints and is designed to
exert smooth dynamics computations.
-->
<statistic center=".4 0 .8" extent="1.3"/>
<option wind="5 5 0" density="10" solver="CG" tolerance="1e-6">
</option>
<extension>
<plugin plugin="mujoco.elasticity.shell"/>
</extension>
<worldbody>
<geom name="floor" type="plane" size="0 0 .1"/>
<light diffuse=".6 .6 .6" specular="0.2 0.2 0.2" pos="0 0 4" dir="0 0 -1"/>
<body name="pin" pos="0 0 1.5">
<flexcomp type="grid" count="9 19 1" spacing=".05 .05 .05" mass="10"
name="flag" radius="0.001">
<edge equality="true" damping="0.001"/>
<plugin plugin="mujoco.elasticity.shell">
<config key="poisson" value="0"/>
<config key="thickness" value="1e-2"/>
<!--Units are in Pa (SI)-->
<config key="young" value="3e6"/>
</plugin>
</flexcomp>
</body>
</worldbody>
<equality>
<connect body1="flag_0" anchor="0 0 0"/>
</equality>
</mujoco> I try to compile this using PyMJCF in this code here: from dm_control import mjcf
mjcf_root = mjcf.from_path("flag_flex.xml")
physics = mjcf.Physics.from_mjcf_model(mjcf_root) I get this error below:
|
The documentation and the code seem to agree that this is a boolean, @quagla any idea what's going on here? |
I am facing a similar issue. It seem's like dm control does not have support for flexcomp just yet? Just wanted to make sure that this is the case or if there's something I am missing. Here's the code I was trying to implement:
bag_physics = dm_mujoco.Physics.from_xml_string(bag_xml) The error I get is: File ~/miniconda3/envs/roco/lib/python3.8/site-packages/dm_control/mujoco/engine.py:436, in Physics.from_xml_string(cls, xml_string, assets) File ~/miniconda3/envs/roco/lib/python3.8/site-packages/dm_control/mujoco/engine.py:419, in Physics.from_model(cls, model) File ~/miniconda3/envs/roco/lib/python3.8/site-packages/dm_control/mujoco/engine.py:123, in Physics.init(self, data) KeyError: 'name_flexadr'` |
Any updates regarding this issue? I'm also facing a very similar issue. |
Mujoco 3.0 introduced flexcomp object for modelling deformable obejcts.
However trying to create a Prop using
Errors out as flexcomp is not recoginzed as part of schema.
I modified schema.xml(which is part of mjcf under dm_control) and after adding all the tags and attibutes that I am using in an xml such as below
I can get the xml to be parsed and get a Prop object. I looked at composite as an example and copied over the spec as described in mujoco XML reference.
However I cannot get the simulation to run and it fails at this line
self._qp_mapper = _CartesianVelocityMapper(qp_params)
indm_robotics/moma/effectors/cartesian_6d_velocity_effector.py
. The error isProcess finished with exit code 139 (interrupted by signal 11:SIGSEGV)
which just sounds like it crashedI cannot understand why. The whole file which I am running is
Which is just a modification of the basic example in [dm_robotics_panda] (https://github.com/JeanElsner/dm_robotics_panda)
Commenting out creating of Cloth and adding to props list works fine.
The text was updated successfully, but these errors were encountered: