parameters: (robot,ambientspace,drivers=None)
return_statement: return AffineEmbeddedCSpace(ambientspace,A,b)
docstring: Creates an AffineEmbeddedCSpace for a robot's drivers.  
  
          Args:
              robot (RobotModel): the robot that you'd like to move
              ambientspace (CSpace): an ambient space on the robot's full DOFs,
                  e.g., RobotCSpace.
              drivers (list of int or list of str, optional): if provided, gives
                  a list of robot's active drivers.
docstring_summary: Creates an AffineEmbeddedCSpace for a robot's drivers.
docstring_tokens: Creates an AffineEmbeddedCSpace for a robot s drivers .
function: def fromRobotDrivers(robot,ambientspace,drivers=None):
          """Creates an AffineEmbeddedCSpace for a robot's drivers.  
  
          Args:
              robot (RobotModel): the robot that you'd like to move
              ambientspace (CSpace): an ambient space on the robot's full DOFs,
                  e.g., RobotCSpace.
              drivers (list of int or list of str, optional): if provided, gives
                  a list of robot's active drivers.
          """
          if drivers is None:
              drivers = range(robot.numDrivers())
              m = robot.numDrivers()
          else:
              m = len(drivers)
          try:
              import scipy.sparse
              data = []
              rows = []
              cols = []
              b = [0]*robot.numLinks()
              for i,dind in enumerate(drivers):
                  d = robot.driver(dind)
                  links = d.getAffectedLinks()
                  if d.getType() != 'affine':
                      data.append(1)
                      rows.append(links[0])
                      cols.append(i)
                  else:
                      scale,offset = d.getAffineCoeffs()
                      for j,s,o in zip(links,scale,offset):
                          data.append(s)
                          rows.append(j)
                          cols.append(i)
                          b[j] = o
              A = scipy.sparse.coo_matrix((data,(rows,cols)),shape=(robot.numLinks(),m))
          except ImportError:
              A = [dict() for i in robot.numLinks()]
              b = [0]*robot.numLinks()
              for i,dind in enumerate(drivers):
                  d = robot.driver(dind)
                  links = d.getAffectedLinks()
                  if d.getType() != 'affine':
                      A[links[0]][i] = 1
                  else:
                      scale,offset = d.getAffineCoeffs()
                      for j,s,o in zip(links,scale,offset):
                          A[j][i] = s
                          b[j] = o
          return AffineEmbeddedCSpace(ambientspace,A,b)
function_tokens: def fromRobotDrivers ( robot , ambientspace , drivers = None ) : if drivers is None : drivers = range ( robot . numDrivers ( ) ) m = robot . numDrivers ( ) else : m = len ( drivers ) try : import scipy . sparse data = [ ] rows = [ ] cols = [ ] b = [ 0 ] * robot . numLinks ( ) for i , dind in enumerate ( drivers ) : d = robot . driver ( dind ) links = d . getAffectedLinks ( ) if d . getType ( ) != 'affine' : data . append ( 1 ) rows . append ( links [ 0 ] ) cols . append ( i ) else : scale , offset = d . getAffineCoeffs ( ) for j , s , o in zip ( links , scale , offset ) : data . append ( s ) rows . append ( j ) cols . append ( i ) b [ j ] = o A = scipy . sparse . coo_matrix ( ( data , ( rows , cols ) ) , shape = ( robot . numLinks ( ) , m ) ) except ImportError : A = [ dict ( ) for i in robot . numLinks ( ) ] b = [ 0 ] * robot . numLinks ( ) for i , dind in enumerate ( drivers ) : d = robot . driver ( dind ) links = d . getAffectedLinks ( ) if d . getType ( ) != 'affine' : A [ links [ 0 ] ] [ i ] = 1 else : scale , offset = d . getAffineCoeffs ( ) for j , s , o in zip ( links , scale , offset ) : A [ j ] [ i ] = s b [ j ] = o return AffineEmbeddedCSpace ( ambientspace , A , b )