nclt2ros/transformer/velodyne_sync_data.py
def read_next_velodyne_sync_packet(self, file):
        """reads one velodyne sync binary file, equals one revolution of the velodyne sensor

        :param file: one binary file from the velodyne_sync directory

        :return: hits: list, containing the x, y, z, intensity, laser_id of the pointcloud
        """

        try:
            os.chdir(self.velodyne_sync_data_dir)
            f_bin = open(file, "r")

            hits = []
            while True:

                x_str = f_bin.read(2)
                if x_str == '':  # eof
                    break

                x         = struct.unpack('<H', x_str)[0]
                y         = struct.unpack('<H', f_bin.read(2))[0]
                z         = struct.unpack('<H', f_bin.read(2))[0]
                intensity = struct.unpack('B', f_bin.read(1))[0]
                laser_id  = struct.unpack('B', f_bin.read(1))[0]

                x, y, z = self.convert_velodyne(x, y, z)
                y = y * -1
                z = z * -1
                hits += [x, y, z, intensity, laser_id]

            f_bin.close()

            return hits

        except Exception as e:
            print(e)
reads one velodyne sync binary file, equals one revolution of the velodyne sensor

        :param file: one binary file from the velodyne_sync directory

        :return: hits: list, containing the x, y, z, intensity, laser_id of the pointcloud
        
reads one velodyne sync binary file, equals one revolution of the velodyne sensor
reads one velodyne sync binary file equals one revolution of the velodyne sensor
def read_next_velodyne_sync_packet(self, file):
        try:
            os.chdir(self.velodyne_sync_data_dir)
            f_bin = open(file, "r")
            hits = []
            while True:
                x_str = f_bin.read(2)
                if x_str == '':  
                    break
                x         = struct.unpack('<H', x_str)[0]
                y         = struct.unpack('<H', f_bin.read(2))[0]
                z         = struct.unpack('<H', f_bin.read(2))[0]
                intensity = struct.unpack('B', f_bin.read(1))[0]
                laser_id  = struct.unpack('B', f_bin.read(1))[0]
                x, y, z = self.convert_velodyne(x, y, z)
                y = y * -1
                z = z * -1
                hits += [x, y, z, intensity, laser_id]
            f_bin.close()
            return hits
        except Exception as e:
            print(e)
def read_next_velodyne_sync_packet ( self , file ) : try : os . chdir ( self . velodyne_sync_data_dir ) f_bin = open ( file , "r" ) hits = [ ] while True : x_str = f_bin . read ( 2 ) if x_str == '' : break x = struct . unpack ( '<H' , x_str ) [ 0 ] y = struct . unpack ( '<H' , f_bin . read ( 2 ) ) [ 0 ] z = struct . unpack ( '<H' , f_bin . read ( 2 ) ) [ 0 ] intensity = struct . unpack ( 'B' , f_bin . read ( 1 ) ) [ 0 ] laser_id = struct . unpack ( 'B' , f_bin . read ( 1 ) ) [ 0 ] x , y , z = self . convert_velodyne ( x , y , z ) y = y * - 1 z = z * - 1 hits += [ x , y , z , intensity , laser_id ] f_bin . close ( ) return hits except Exception as e : print ( e )
reads one velodyne sync binary file, equals one revolution of the velodyne sensor
reads one velodyne sync binary file equals one revolution of the velodyne sensor
"""reads one velodyne sync binary file, equals one revolution of the velodyne sensor

        :param file: one binary file from the velodyne_sync directory

        :return: hits: list, containing the x, y, z, intensity, laser_id of the pointcloud
        """ # eof
list, containing the x, y, z, intensity, laser_id of the pointcloud
list containing the x y z intensity laser_id of the pointcloud
self
file
one binary file from the velodyne_sync directory
one binary file from the velodyne_sync directory