(attachment_frames, fixed_indices)
Adds or removes freejoints from props.

  Args:
    attachment_frames: A list of `mjcf.Elements` corresponding to attachment
      frames.
    fixed_indices: A list of indices of attachment frames that should be fixed
      to the world (i.e. have their freejoints removed). Freejoints will be
      added to all other elements in `attachment_frames` if they do not already
      possess them.
Adds or removes freejoints from props.
Adds or removes freejoints from props .
def _add_or_remove_freejoints(attachment_frames, fixed_indices):
  """Adds or removes freejoints from props.

  Args:
    attachment_frames: A list of `mjcf.Elements` corresponding to attachment
      frames.
    fixed_indices: A list of indices of attachment frames that should be fixed
      to the world (i.e. have their freejoints removed). Freejoints will be
      added to all other elements in `attachment_frames` if they do not already
      possess them.
  """
  for i, frame in enumerate(attachment_frames):
    if i in fixed_indices:
      if frame.freejoint:
        frame.freejoint.remove()
    elif not frame.freejoint:
      frame.add('freejoint')
def _add_or_remove_freejoints ( attachment_frames , fixed_indices ) : for i , frame in enumerate ( attachment_frames ) : if i in fixed_indices : if frame . freejoint : frame . freejoint . remove ( ) elif not frame . freejoint : frame . add ( 'freejoint' )