parameters: (
          link: RobotModelLink,
          ref: Union[None,RobotModelLink,RigidObjectModel] = None,
          local_axis: Optional[Vector3] = None,
          world_axis: Optional[Vector3] = None
      )
return_statement: return obj
docstring: Convenience function for fixing the given link at its current
      orientation in space. 
  
      The arguments are interpreted as follows:
  
      - If `local_axis` and `world_axis` are not provided, the entire link's
        orientation is constrained.
  
      - If only `local_axis` is provided, the link is constrained
        to rotate about this local axis. 
  
      - If only `world_axis` is provided,
        the link is constrained to rotate about this world-space axis.
  
  
      Args:
          link (RobotModelLink): the link that should be constrained.
          ref (RobotModelLink or RigidObjectModel, optional): the link that
              `link` should be constrained to, or None for the world frame.
          local_axis (3-vector, optional): the local direction on
              on `body` that should be constrained in place.
          world_axis (3-vector, optional): the world coordinates
              of the direction that should be constrained.
docstring_summary: Convenience function for fixing the given link at its current
      orientation in space.
docstring_tokens: Convenience function for fixing the given link at its current orientation in space .
function: def fixed_rotation_objective(
          link: RobotModelLink,
          ref: Union[None,RobotModelLink,RigidObjectModel] = None,
          local_axis: Optional[Vector3] = None,
          world_axis: Optional[Vector3] = None
      ) -> IKObjective:
      """Convenience function for fixing the given link at its current
      orientation in space. 
  
      The arguments are interpreted as follows:
  
      - If `local_axis` and `world_axis` are not provided, the entire link's
        orientation is constrained.
  
      - If only `local_axis` is provided, the link is constrained
        to rotate about this local axis. 
  
      - If only `world_axis` is provided,
        the link is constrained to rotate about this world-space axis.
  
  
      Args:
          link (RobotModelLink): the link that should be constrained.
          ref (RobotModelLink or RigidObjectModel, optional): the link that
              `link` should be constrained to, or None for the world frame.
          local_axis (3-vector, optional): the local direction on
              on `body` that should be constrained in place.
          world_axis (3-vector, optional): the world coordinates
              of the direction that should be constrained.
  
      """
      refcoords = ref.getTransform()[0] if ref is not None else so3.identity()
      Rw = link.getTransform()
      Rrel = so3.mul(so3.inv(refcoords),Rw[0])
      obj = IKObjective()
      obj.robot = link.robot()
      if ref:
          assert link.robot()==ref.robot(),"Can't do generalized fixed rotation objectives yet"
      obj.setLinks(link.index,(-1 if ref is None else ref.index))
      if local_axis is None and world_axis is None:
          #fixed rotation objective
          obj.setFixedRotConstraint(Rrel)
      elif local_axis is None:
          #fixed axis, given by world coordinates
          Rrelinv = so3.inv(Rrel)
          local_axis = so3.apply(Rrelinv,world_axis)
          obj.setAxialRotConstraint(local_axis,world_axis)
      elif world_axis is None:
          #fixed point, given by local coordinates
          world_axis = so3.apply(Rrel,local_axis)
          obj.setAxialRotConstraint(local_axis,world_axis)
      else:
          raise ValueError("ik.fixed_rotation_objective does not accept both local_axis and world_axis keyword arguments")
      return obj
function_tokens: def fixed_rotation_objective ( link : RobotModelLink , ref : Union [ None , RobotModelLink , RigidObjectModel ] = None , local_axis : Optional [ Vector3 ] = None , world_axis : Optional [ Vector3 ] = None ) -> IKObjective : refcoords = ref . getTransform ( ) [ 0 ] if ref is not None else so3 . identity ( ) Rw = link . getTransform ( ) Rrel = so3 . mul ( so3 . inv ( refcoords ) , Rw [ 0 ] ) obj = IKObjective ( ) obj . robot = link . robot ( ) if ref : assert link . robot ( ) == ref . robot ( ) , "Can't do generalized fixed rotation objectives yet" obj . setLinks ( link . index , ( - 1 if ref is None else ref . index ) ) if local_axis is None and world_axis is None : #fixed rotation objective obj . setFixedRotConstraint ( Rrel ) elif local_axis is None : #fixed axis, given by world coordinates Rrelinv = so3 . inv ( Rrel ) local_axis = so3 . apply ( Rrelinv , world_axis ) obj . setAxialRotConstraint ( local_axis , world_axis ) elif world_axis is None : #fixed point, given by local coordinates world_axis = so3 . apply ( Rrel , local_axis ) obj . setAxialRotConstraint ( local_axis , world_axis ) else : raise ValueError ( "ik.fixed_rotation_objective does not accept both local_axis and world_axis keyword arguments" ) return obj