parameters: (self)
docstring: @raise ROSBagException: if the bag version is unsupported
function: def _create_reader(self):
          """
          @raise ROSBagException: if the bag version is unsupported
          """
          major_version, minor_version = int(self._version / 100), self._version % 100
          if major_version == 2:
              self._reader = _BagReader200(self)
          elif major_version == 1:
              if minor_version == 1:
                  raise ROSBagException('unsupported bag version %d. Please convert bag to newer format.' % self._version)
              else:
                  # Get the op code of the first record.  If it's FILE_HEADER, then we have an indexed 1.2 bag.
                  first_record_pos = self._file.tell()
                  header = _read_header(self._file)
                  op = _read_uint8_field(header, 'op')
                  self._file.seek(first_record_pos)
      
                  if op == _OP_FILE_HEADER:
                      self._reader = _BagReader102_Indexed(self)
                  else:
                      self._reader = _BagReader102_Unindexed(self)
          else:
              raise ROSBagException('unknown bag version %d' % self._version)
function_tokens: def _create_reader ( self ) : major_version , minor_version = int ( self . _version / 100 ) , self . _version % 100 if major_version == 2 : self . _reader = _BagReader200 ( self ) elif major_version == 1 : if minor_version == 1 : raise ROSBagException ( 'unsupported bag version %d. Please convert bag to newer format.' % self . _version ) else : # Get the op code of the first record.  If it's FILE_HEADER, then we have an indexed 1.2 bag. first_record_pos = self . _file . tell ( ) header = _read_header ( self . _file ) op = _read_uint8_field ( header , 'op' ) self . _file . seek ( first_record_pos ) if op == _OP_FILE_HEADER : self . _reader = _BagReader102_Indexed ( self ) else : self . _reader = _BagReader102_Unindexed ( self ) else : raise ROSBagException ( 'unknown bag version %d' % self . _version )