parameters: (self,robot=None,iktype=None,forceikfast=False,freeindices=None,freejoints=None,manip=None, checkpreemptfn=None)
docstring: :param robot: if not None, will use the robot's active manipulator
          :param manip: if not None, will the manipulator, takes precedence over robot
          :param forceikfast: if set will always force the ikfast solver
          :param freeindices: force the following freeindices on the ik solver
          :param checkpreemptfn: a function to check if ik generation should be canceled
docstring_summary: :param robot: if not None, will use the robot's active manipulator
          :param manip: if not None, will the manipulator, takes precedence over robot
          :param forceikfast: if set will always force the ikfast solver
          :param freeindices: force the following freeindices on the ik solver
          :param checkpreemptfn: a function to check if ik generation should be canceled
docstring_tokens: : param robot : if not None will use the robot s active manipulator : param manip : if not None will the manipulator takes precedence over robot : param forceikfast : if set will always force the ikfast solver : param freeindices : force the following freeindices on the ik solver : param checkpreemptfn : a function to check if ik generation should be canceled
function: def __init__(self,robot=None,iktype=None,forceikfast=False,freeindices=None,freejoints=None,manip=None, checkpreemptfn=None):
          """
          :param robot: if not None, will use the robot's active manipulator
          :param manip: if not None, will the manipulator, takes precedence over robot
          :param forceikfast: if set will always force the ikfast solver
          :param freeindices: force the following freeindices on the ik solver
          :param checkpreemptfn: a function to check if ik generation should be canceled
          """
          if manip is not None:
              robot = manip.GetRobot()
          else:
              manip = robot.GetActiveManipulator()
          DatabaseGenerator.__init__(self,robot=robot)
          self.manip = manip
          # check if robot manipulator has no static links (except the base)
          for link in robot.GetChain(manip.GetBase().GetIndex(),manip.GetEndEffector().GetIndex(),returnjoints=False)[1:]:
              for rigidlyattached in link.GetRigidlyAttachedLinks():
                  if rigidlyattached.IsStatic():
                      raise InverseKinematicsError(u'link %s part of IK chain cannot be declared static'%link)
          try:
              self.ikfast = __import__('openravepy.ikfast',fromlist=['openravepy'])
          except ImportError as e:
              log.warn('failed to import ikfast, so reverting to older version: %s',e)
              self.ikfast = __import__('openravepy.ikfast_sympy0_6',fromlist=['openravepy'])
          for handler in log.handlers:
              self.ikfast.log.addHandler(handler)
          self.ikfastproblem = RaveCreateModule(self.env,'ikfast')
          if self.ikfastproblem is not None:
              self.env.Add(self.ikfastproblem)
          self.iktype = iktype
          self.iksolver = None
          self.freeinc = None
          if freeindices is not None:
              self.freeindices = freeindices
          elif freejoints is not None:
              self.freeindices = self.getIndicesFromJointNames(freejoints)
          else:
              self.freeindices = None
          if self.freeindices is None:
              self.solveindices = None
          else:
              if not all([ifree in manip.GetArmIndices() for ifree in self.freeindices]):
                  raise InverseKinematicsError(u'not all free indices %r are part of the manipulator indices %r'%(self.freeindices, manip.GetArmIndices()))
              
              self.solveindices = [i for i in manip.GetArmIndices() if not i in self.freeindices]
          self.forceikfast = forceikfast
          self.ikfeasibility = None # if not None, ik is NOT feasibile and contains the error message
          self.statistics = dict()
          self._checkpreemptfn=checkpreemptfn
function_tokens: def __init__ ( self , robot = None , iktype = None , forceikfast = False , freeindices = None , freejoints = None , manip = None , checkpreemptfn = None ) : if manip is not None : robot = manip . GetRobot ( ) else : manip = robot . GetActiveManipulator ( ) DatabaseGenerator . __init__ ( self , robot = robot ) self . manip = manip # check if robot manipulator has no static links (except the base) for link in robot . GetChain ( manip . GetBase ( ) . GetIndex ( ) , manip . GetEndEffector ( ) . GetIndex ( ) , returnjoints = False ) [ 1 : ] : for rigidlyattached in link . GetRigidlyAttachedLinks ( ) : if rigidlyattached . IsStatic ( ) : raise InverseKinematicsError ( u'link %s part of IK chain cannot be declared static' % link ) try : self . ikfast = __import__ ( 'openravepy.ikfast' , fromlist = [ 'openravepy' ] ) except ImportError as e : log . warn ( 'failed to import ikfast, so reverting to older version: %s' , e ) self . ikfast = __import__ ( 'openravepy.ikfast_sympy0_6' , fromlist = [ 'openravepy' ] ) for handler in log . handlers : self . ikfast . log . addHandler ( handler ) self . ikfastproblem = RaveCreateModule ( self . env , 'ikfast' ) if self . ikfastproblem is not None : self . env . Add ( self . ikfastproblem ) self . iktype = iktype self . iksolver = None self . freeinc = None if freeindices is not None : self . freeindices = freeindices elif freejoints is not None : self . freeindices = self . getIndicesFromJointNames ( freejoints ) else : self . freeindices = None if self . freeindices is None : self . solveindices = None else : if not all ( [ ifree in manip . GetArmIndices ( ) for ifree in self . freeindices ] ) : raise InverseKinematicsError ( u'not all free indices %r are part of the manipulator indices %r' % ( self . freeindices , manip . GetArmIndices ( ) ) ) self . solveindices = [ i for i in manip . GetArmIndices ( ) if not i in self . freeindices ] self . forceikfast = forceikfast self . ikfeasibility = None # if not None, ik is NOT feasibile and contains the error message self . statistics = dict ( ) self . _checkpreemptfn = checkpreemptfn