parameters: (self,robot,links)
docstring: Args:
              robot (RobotModel or SubRobotModel): the robot to base this on.
              links (list of ints or strs): the links to use in this sub-robot.
docstring_summary: Args:
              robot (RobotModel or SubRobotModel): the robot to base this on.
              links (list of ints or strs): the links to use in this sub-robot.
docstring_tokens: Args : robot ( RobotModel or SubRobotModel ) : the robot to base this on . links ( list of ints or strs ) : the links to use in this sub - robot .
function: def __init__(self,robot,links):
          """
          Args:
              robot (RobotModel or SubRobotModel): the robot to base this on.
              links (list of ints or strs): the links to use in this sub-robot.
          """
          assert isinstance(robot,(RobotModel,SubRobotModel)),"SubRobotModel constructor must be given a RobotModel or SubRobotModel as first argument"
          self._robot = robot
          self._links = links[:]
          self._drivers = None
          self.index = robot.index
          self.world = robot.world
          if isinstance(robot,SubRobotModel):
              warnings.warn("Taking sub-robot of sub-robot... not tested yet")
              self._robot = robot._robot
          for i,l in enumerate(self._links):
              if isinstance(l,str):
                  self._links[i] = robot.link(l).getIndex()
          self._inv_links = dict((l,i) for (i,l) in enumerate(self._links))
function_tokens: def __init__ ( self , robot , links ) : assert isinstance ( robot , ( RobotModel , SubRobotModel ) ) , "SubRobotModel constructor must be given a RobotModel or SubRobotModel as first argument" self . _robot = robot self . _links = links [ : ] self . _drivers = None self . index = robot . index self . world = robot . world if isinstance ( robot , SubRobotModel ) : warnings . warn ( "Taking sub-robot of sub-robot... not tested yet" ) self . _robot = robot . _robot for i , l in enumerate ( self . _links ) : if isinstance ( l , str ) : self . _links [ i ] = robot . link ( l ) . getIndex ( ) self . _inv_links = dict ( ( l , i ) for ( i , l ) in enumerate ( self . _links ) )