parameters: (
          body: Union[RobotModelLink,RigidObjectModel],
          ref: Union[None,RobotModelLink,RigidObjectModel] = None,
          local: Union[None,Vector3,List[Vector3]] = None,
          world: Union[None,Vector3,List[Vector3]] = None,
          R: Optional[Rotation] = None,
          t: Optional[Vector3] = None
      )
docstring: Returns an IKObjective for a given body.
  
      There are two modes in which this can be used:
  
      1. If `local` and `world` are provided, then this objective asks to match 
         the local point (s) on the body to the world point(s).
      2. If `R` and `t` are provided, then the objective is set to specify the
         transform of the body.
  
      If `ref` is given, then this is the target frame; otherwise it's the world
      frame.  In mode 1, the world points are bound to this frame; in mode 2,
      the transformation from body to ref is specified as (R,t).
  
      Args:
          body (RobotModelLink or RigidObjectModel): the link that should be
              constrained.
          ref (RobotModelLink or RigidObjectModel, optional): the link that
              `body` should be constrained to, or None for the world frame.
          local (3-vector, or a list of 3-vectors, optional): the local 
              coordinates on `body` should be constrained to the corresponding
              points in `world`
          world (3-vector, or a list of 3-vectors, optional): the coordinates
              to which the points in `local` should be constrained. These are
              given in world coordinates (if `ref`=None) or in `ref`'s frame.
          R (so3 element; list of 9 floats, optional): the rotation that the
              link should take on.
          t (3-vector, optional): the translation that the link's origin
          should take on.
  
      Returns:
          An IK objective describing the constraint.
  
          If body and ref are not on the same robot, then a
          GeneralizedIKObjective may be returned. TODO: not implemented yet.
docstring_summary: Returns an IKObjective for a given body.
docstring_tokens: Returns an IKObjective for a given body .
function: def objective(
          body: Union[RobotModelLink,RigidObjectModel],
          ref: Union[None,RobotModelLink,RigidObjectModel] = None,
          local: Union[None,Vector3,List[Vector3]] = None,
          world: Union[None,Vector3,List[Vector3]] = None,
          R: Optional[Rotation] = None,
          t: Optional[Vector3] = None
      ) -> IKObjective:
      """Returns an IKObjective for a given body.
  
      There are two modes in which this can be used:
  
      1. If `local` and `world` are provided, then this objective asks to match 
         the local point (s) on the body to the world point(s).
      2. If `R` and `t` are provided, then the objective is set to specify the
         transform of the body.
  
      If `ref` is given, then this is the target frame; otherwise it's the world
      frame.  In mode 1, the world points are bound to this frame; in mode 2,
      the transformation from body to ref is specified as (R,t).
  
      Args:
          body (RobotModelLink or RigidObjectModel): the link that should be
              constrained.
          ref (RobotModelLink or RigidObjectModel, optional): the link that
              `body` should be constrained to, or None for the world frame.
          local (3-vector, or a list of 3-vectors, optional): the local 
              coordinates on `body` should be constrained to the corresponding
              points in `world`
          world (3-vector, or a list of 3-vectors, optional): the coordinates
              to which the points in `local` should be constrained. These are
              given in world coordinates (if `ref`=None) or in `ref`'s frame.
          R (so3 element; list of 9 floats, optional): the rotation that the
              link should take on.
          t (3-vector, optional): the translation that the link's origin
          should take on.
  
      Returns:
          An IK objective describing the constraint.
  
          If body and ref are not on the same robot, then a
          GeneralizedIKObjective may be returned. TODO: not implemented yet.
      """
      generalized = False
      if not hasattr(body,'robot'):
          generalized = True
      else: 
          if ref and (not hasattr(ref,'robot') or ref.robot() != body.robot()):
              generalized=True
  
      if generalized:
          obj = None
          if ref:
              obj = GeneralizedIKObjective(body,ref)
          else:
              obj = GeneralizedIKObjective(body)
          if (local is not None) and (world is not None):
              assert(len(local)==len(world))
              if hasattr(local[0],'__iter__'):
                  #sanity check
                  for pt in local:
                      assert(len(pt)==3)
                  for pt in world:
                      assert(len(pt)==3)
                  obj.setPoints(local,world)
              else:
                  obj.setPoint(local,world)
          elif R and t:
              obj.setTransform(R,t)
          else:
              raise RuntimeError("Need to specify either local and world or R and t")
          return obj
      else:
          obj = IKObjective()
          obj.robot = body.robot()
          if (local is not None) and (world is not None):
              assert(len(local)==len(world))
              if hasattr(local[0],'__iter__'):
                  #sanity check
                  for pt in local:
                      assert(len(pt)==3)
                  for pt in world:
                      assert(len(pt)==3)
                  if ref:
                      obj.setRelativePoints(body.index,ref.index,local,world)
                  else:
                      obj.setFixedPoints(body.index,local,world)
              else:
                  if ref:
                      obj.setRelativePoint(body.index,ref.index,local,world)
                  else:
                      obj.setFixedPoint(body.index,local,world)
          elif (R is not None) and (t is not None):
              if ref:
                  obj.setRelativeTransform(body.index,ref.index,R,t)
              else:
                  obj.setFixedTransform(body.index,R,t)
          else:
              raise RuntimeError("Need to specify either local and world or R and t")
          return obj
function_tokens: def objective ( body : Union [ RobotModelLink , RigidObjectModel ] , ref : Union [ None , RobotModelLink , RigidObjectModel ] = None , local : Union [ None , Vector3 , List [ Vector3 ] ] = None , world : Union [ None , Vector3 , List [ Vector3 ] ] = None , R : Optional [ Rotation ] = None , t : Optional [ Vector3 ] = None ) -> IKObjective : generalized = False if not hasattr ( body , 'robot' ) : generalized = True else : if ref and ( not hasattr ( ref , 'robot' ) or ref . robot ( ) != body . robot ( ) ) : generalized = True if generalized : obj = None if ref : obj = GeneralizedIKObjective ( body , ref ) else : obj = GeneralizedIKObjective ( body ) if ( local is not None ) and ( world is not None ) : assert ( len ( local ) == len ( world ) ) if hasattr ( local [ 0 ] , '__iter__' ) : #sanity check for pt in local : assert ( len ( pt ) == 3 ) for pt in world : assert ( len ( pt ) == 3 ) obj . setPoints ( local , world ) else : obj . setPoint ( local , world ) elif R and t : obj . setTransform ( R , t ) else : raise RuntimeError ( "Need to specify either local and world or R and t" ) return obj else : obj = IKObjective ( ) obj . robot = body . robot ( ) if ( local is not None ) and ( world is not None ) : assert ( len ( local ) == len ( world ) ) if hasattr ( local [ 0 ] , '__iter__' ) : #sanity check for pt in local : assert ( len ( pt ) == 3 ) for pt in world : assert ( len ( pt ) == 3 ) if ref : obj . setRelativePoints ( body . index , ref . index , local , world ) else : obj . setFixedPoints ( body . index , local , world ) else : if ref : obj . setRelativePoint ( body . index , ref . index , local , world ) else : obj . setFixedPoint ( body . index , local , world ) elif ( R is not None ) and ( t is not None ) : if ref : obj . setRelativeTransform ( body . index , ref . index , R , t ) else : obj . setFixedTransform ( body . index , R , t ) else : raise RuntimeError ( "Need to specify either local and world or R and t" ) return obj