parameters: (self, name : str, interface : RobotInterfaceBase, indices : Sequence[int]=None)
docstring: Adds a new part corresponding to a physical RIL implementation.
          
          If klamptModel was not provided to the initializer, then this part will
          be appended to the list of parts, and indices=None is allowed. 
          Otherwise, indices needs to be a list of driver indices corresponding
          to the part in klamptModel.
docstring_summary: Adds a new part corresponding to a physical RIL implementation.
          
          If klamptModel was not provided to the initializer, then this part will
          be appended to the list of parts, and indices=None is allowed. 
          Otherwise, indices needs to be a list of driver indices corresponding
          to the part in klamptModel.
docstring_tokens: Adds a new part corresponding to a physical RIL implementation . If klamptModel was not provided to the initializer then this part will be appended to the list of parts and indices = None is allowed . Otherwise indices needs to be a list of driver indices corresponding to the part in klamptModel .
function: def addPhysicalPart(self, name : str, interface : RobotInterfaceBase, indices : Sequence[int]=None) -> None:
          """Adds a new part corresponding to a physical RIL implementation.
          
          If klamptModel was not provided to the initializer, then this part will
          be appended to the list of parts, and indices=None is allowed. 
          Otherwise, indices needs to be a list of driver indices corresponding
          to the part in klamptModel.
          """
          if name in self._structure.parts:
              raise ValueError("Part named {} already exists".format(name))
          n = self.numJoints()
          if indices is None:
              if self._structure.klamptModel is not None:
                  raise ValueError("Must specify indices for a physical part when a unified klamptModel has been defined")
              try:
                  ni = interface.numJoints()
              except NotImplementedError:
                  raise ValueError("When building up an OmniRobotInterface, the physical interface must implement numJoints()")
              indices = list(range(n,n+ni))
              self._structure.numJoints += ni
              self._structure.parts[None] = list(range(self._structure.numJoints))
          else:
              if self._structure.klamptModel is None:
                  if any(i < n for i in indices):
                      raise ValueError("When building up an OmniRobotInterface, all indices must be contiguous and added in order")
              else:
                  for i in indices:
                      assert i >= 0 and i < n,"Invalid index {} must be in range [0,{}]".format(i,n-1)
          if not isinstance(interface,_RobotInterfaceStatefulWrapper):
              interface = _RobotInterfaceStatefulWrapper(interface)
          self._physicalParts[name] = interface
          interface.properties['name'] = name
          interface.properties['part'] = True
          self._physicalPartIndices[name] = indices
          self._physicalPartUpdateTimes[name] = 0
          self._structure.parts[name] = self._physicalPartIndices[name]
function_tokens: def addPhysicalPart ( self , name : str , interface : RobotInterfaceBase , indices : Sequence [ int ] = None ) -> None : if name in self . _structure . parts : raise ValueError ( "Part named {} already exists" . format ( name ) ) n = self . numJoints ( ) if indices is None : if self . _structure . klamptModel is not None : raise ValueError ( "Must specify indices for a physical part when a unified klamptModel has been defined" ) try : ni = interface . numJoints ( ) except NotImplementedError : raise ValueError ( "When building up an OmniRobotInterface, the physical interface must implement numJoints()" ) indices = list ( range ( n , n + ni ) ) self . _structure . numJoints += ni self . _structure . parts [ None ] = list ( range ( self . _structure . numJoints ) ) else : if self . _structure . klamptModel is None : if any ( i < n for i in indices ) : raise ValueError ( "When building up an OmniRobotInterface, all indices must be contiguous and added in order" ) else : for i in indices : assert i >= 0 and i < n , "Invalid index {} must be in range [0,{}]" . format ( i , n - 1 ) if not isinstance ( interface , _RobotInterfaceStatefulWrapper ) : interface = _RobotInterfaceStatefulWrapper ( interface ) self . _physicalParts [ name ] = interface interface . properties [ 'name' ] = name interface . properties [ 'part' ] = True self . _physicalPartIndices [ name ] = indices self . _physicalPartUpdateTimes [ name ] = 0 self . _structure . parts [ name ] = self . _physicalPartIndices [ name ]