parameters: (objectives,maxDeviation,iters=1000,tol=1e-3,activeDofs=None,numRestarts=0,feasibilityCheck=None)
return_statement: return False
docstring: Solves for an IK solution that does not deviate too far from the
      initial configuration.
  
      Note:
          Currently only supports single-robot objectives!
      
      Args: 
          objectives, iters, tol, activeDofs, feasibilityCheck: same as :func:`solve_global` except for...
          maxDeviation (float): the maximum absolute amount in configuration space that
              each configuration element is allowed to change.
          numRestarts (int): same as in :func:`solve_global` , but is by default set to zero.
docstring_summary: Solves for an IK solution that does not deviate too far from the
      initial configuration.
docstring_tokens: Solves for an IK solution that does not deviate too far from the initial configuration .
function: def solve_nearby(objectives,maxDeviation,iters=1000,tol=1e-3,activeDofs=None,numRestarts=0,feasibilityCheck=None):
      """Solves for an IK solution that does not deviate too far from the
      initial configuration.
  
      Note:
          Currently only supports single-robot objectives!
      
      Args: 
          objectives, iters, tol, activeDofs, feasibilityCheck: same as :func:`solve_global` except for...
          maxDeviation (float): the maximum absolute amount in configuration space that
              each configuration element is allowed to change.
          numRestarts (int): same as in :func:`solve_global` , but is by default set to zero.
      """
      if feasibilityCheck is None: feasibilityCheck=lambda : True
      s = solver(objectives,iters,tol)
      if not isinstance(s,IKSolver):
          raise NotImplementedError("solve_nearby: currently only supports single-robot objectives")
      if hasattr(objectives,'__iter__'):
          robot = objectives[0].robot
      else:
          robot = objectives.robot
      if activeDofs is not None:
          links = activeDofs[:]
          for i,l in enumerate(links):
              if isinstance(l,str):
                  links[i] = s.robot.link(l).getIndex()
          s.setActiveDofs(links)
      #set up the joint limits
      dofs = s.getActiveDofs()
      q = robot.getConfig()
      qmin,qmax = robot.getJointLimits()
      for d in dofs:
          qmin[d] = max(qmin[d],q[d]-maxDeviation)
          qmax[d] = min(qmax[d],q[d]+maxDeviation)
      s.setJointLimits(qmin,qmax)
      s.setBiasConfig(q)
      #start solving
      if s.solve():
          if feasibilityCheck():
              return True
      for i in xrange(numRestarts):
          s.sampleInitial()
          if s.solve():
              if feasibilityCheck():
                  return True
      return False
function_tokens: def solve_nearby ( objectives , maxDeviation , iters = 1000 , tol = 1e-3 , activeDofs = None , numRestarts = 0 , feasibilityCheck = None ) : if feasibilityCheck is None : feasibilityCheck = lambda : True s = solver ( objectives , iters , tol ) if not isinstance ( s , IKSolver ) : raise NotImplementedError ( "solve_nearby: currently only supports single-robot objectives" ) if hasattr ( objectives , '__iter__' ) : robot = objectives [ 0 ] . robot else : robot = objectives . robot if activeDofs is not None : links = activeDofs [ : ] for i , l in enumerate ( links ) : if isinstance ( l , str ) : links [ i ] = s . robot . link ( l ) . getIndex ( ) s . setActiveDofs ( links ) #set up the joint limits dofs = s . getActiveDofs ( ) q = robot . getConfig ( ) qmin , qmax = robot . getJointLimits ( ) for d in dofs : qmin [ d ] = max ( qmin [ d ] , q [ d ] - maxDeviation ) qmax [ d ] = min ( qmax [ d ] , q [ d ] + maxDeviation ) s . setJointLimits ( qmin , qmax ) s . setBiasConfig ( q ) #start solving if s . solve ( ) : if feasibilityCheck ( ) : return True for i in xrange ( numRestarts ) : s . sampleInitial ( ) if s . solve ( ) : if feasibilityCheck ( ) : return True return False