Split data from lidar

Hello,

Is it possible to split the lidar data by scan lines? For example i would like to process separately data that exist in the same scan (laser) line and create some metadata.

Thanks in advance.

Yes, we call the scan line ring index. It’s in the pointcloud but dropped by default:

1 Like

Thanks for your answer. I run the function from_file in data_classes.py and I saw that the value of ring_index does not exist everywhere. But wherever it exists, it has always the same value, which is 1. The image I uploaded shows the results for one random lidar file and the columns follow the order (x, y, z, intensity, ring index).

lidar_example

How did you get these results? I picked the first lidar pointcloud and saw meaningful results:

import os
import numpy as np
from nuscenes.utils.data_classes import LidarPointCloud
sd = nusc.get(‘sample_data’, nusc.sample[0][‘data’][‘LIDAR_TOP’])
pcl_path = os.path.join(nusc.dataroot, sd[‘filename’])
scan = np.fromfile(pcl_path, dtype=np.float32)
points = scan.reshape((-1, 5))

points[:, -2]

array([ 4., 1., 2., …, 80., 75., 40.], dtype=float32)

points[:, -1]

array([ 0., 1., 2., …, 29., 30., 31.], dtype=float32)

So ring index really just increments by 1 each time, whereas intensity are meaningful int8 values.