c6c3ec3149
The `<attach>` element now supports a "frame" attribute, allowing users to specify either a "body" or a "frame" to attach to, but not both. The XML parser has been updated to handle this new attribute and the mutual exclusivity constraint. PiperOrigin-RevId: 941245904 Change-Id: I4c0edeed5f3a9e456aed96c373b1647fe79841d9
26 lines
683 B
XML
26 lines
683 B
XML
<mujoco>
|
|
<asset>
|
|
<model name="other" file="child.xml"/>
|
|
</asset>
|
|
<worldbody>
|
|
<!-- attach body to body -->
|
|
<body name="parent">
|
|
<geom name="geom" size="1" pos="0 0 2"/>
|
|
<attach model="other" body="body" prefix="other1"/>
|
|
</body>
|
|
|
|
<!-- attach frame to body (world) -->
|
|
<attach model="other" frame="frame" prefix="other2"/>
|
|
|
|
<!-- attach frame to frame -->
|
|
<frame name="top" pos="0 0 4">
|
|
<attach model="other" frame="frame" prefix="other3"/>
|
|
</frame>
|
|
|
|
<!-- attach body to frame -->
|
|
<frame name="bottom-right" pos="2 0 -1">
|
|
<attach model="other" body="body" prefix="other4"/>
|
|
</frame>
|
|
</worldbody>
|
|
</mujoco>
|