(is_world_attachment)
return frame_spec
Create specs for attachment frames.

  Attachment frames are specialized <body> without an identifier.
  The only allowed children are joints which also don't have identifiers.

  Args:
    is_world_attachment: Whether we are creating a spec for attachments to
      worldbody. If `True`, allow <freejoint> as child.

  Returns:
    An `ElementSpec`.
Create specs for attachment frames.
Create specs for attachment frames .
def _attachment_frame_spec(is_world_attachment):
  """Create specs for attachment frames.

  Attachment frames are specialized <body> without an identifier.
  The only allowed children are joints which also don't have identifiers.

  Args:
    is_world_attachment: Whether we are creating a spec for attachments to
      worldbody. If `True`, allow <freejoint> as child.

  Returns:
    An `ElementSpec`.
  """
  frame_spec = ElementSpec(
      'body', repeated=True, on_demand=False, identifier=None, namespace='body',
      attributes=collections.OrderedDict(),
      children=collections.OrderedDict())

  body_spec = MUJOCO.children['worldbody'].children['body']
  # 'name' and 'childclass' attributes are excluded.
  for attrib_name in (
      'mocap', 'pos', 'quat', 'axisangle', 'xyaxes', 'zaxis', 'euler'):
    frame_spec.attributes[attrib_name] = copy.deepcopy(
        body_spec.attributes[attrib_name])

  inertial_spec = body_spec.children['inertial']
  frame_spec.children['inertial'] = copy.deepcopy(inertial_spec)
  joint_spec = body_spec.children['joint']
  frame_spec.children['joint'] = ElementSpec(
      'joint', repeated=True, on_demand=False,
      identifier=None, namespace='joint',
      attributes=copy.deepcopy(joint_spec.attributes),
      children=collections.OrderedDict())

  if is_world_attachment:
    freejoint_spec = (MUJOCO.children['worldbody']
                      .children['body'].children['freejoint'])
    frame_spec.children['freejoint'] = ElementSpec(
        'freejoint', repeated=False, on_demand=True,
        identifier=None, namespace='joint',
        attributes=copy.deepcopy(freejoint_spec.attributes),
        children=collections.OrderedDict())

  return frame_spec
def _attachment_frame_spec ( is_world_attachment ) : frame_spec = ElementSpec ( 'body' , repeated = True , on_demand = False , identifier = None , namespace = 'body' , attributes = collections . OrderedDict ( ) , children = collections . OrderedDict ( ) ) body_spec = MUJOCO . children [ 'worldbody' ] . children [ 'body' ] # 'name' and 'childclass' attributes are excluded. for attrib_name in ( 'mocap' , 'pos' , 'quat' , 'axisangle' , 'xyaxes' , 'zaxis' , 'euler' ) : frame_spec . attributes [ attrib_name ] = copy . deepcopy ( body_spec . attributes [ attrib_name ] ) inertial_spec = body_spec . children [ 'inertial' ] frame_spec . children [ 'inertial' ] = copy . deepcopy ( inertial_spec ) joint_spec = body_spec . children [ 'joint' ] frame_spec . children [ 'joint' ] = ElementSpec ( 'joint' , repeated = True , on_demand = False , identifier = None , namespace = 'joint' , attributes = copy . deepcopy ( joint_spec . attributes ) , children = collections . OrderedDict ( ) ) if is_world_attachment : freejoint_spec = ( MUJOCO . children [ 'worldbody' ] . children [ 'body' ] . children [ 'freejoint' ] ) frame_spec . children [ 'freejoint' ] = ElementSpec ( 'freejoint' , repeated = False , on_demand = True , identifier = None , namespace = 'joint' , attributes = copy . deepcopy ( freejoint_spec . attributes ) , children = collections . OrderedDict ( ) ) return frame_spec