Coordinates in LIDAR data

Hi. I tried to read in a LIDAR file into Matlab, which looks as follows:

base_path= ‘…\Desktop\data\sets\nuscenes\samples\LIDAR_TOP’;
lidar_data =
fopen([base_path ‘n015-2018-10-02-10-50-40+0800__LIDAR_TOP__1538448748547277.pcd.bin’]);
pointcloud = fread(lidar_data);

As far as I know, the pointcloud is structured in the following way:
For each point, there are the (x,y,z)-coordiantes, the intensity as well as a ring index.
I am confused that I only get integer values in the pointcloud.
For example, the first point yields: x = 233, y = 148, z = 59, i = 192, ri = 120.

Do you have any idea, where these integer values come from? I don’t think that those values are just rounded to the next integer, rather that I messed something up.

Thank for your help.

Hi. Unfortunately I don’t have Matlab here to test this. Looking at the documentation (https://www.mathworks.com/help/matlab/ref/fread.html#btp1twt-1-precision), it sems like the default settings is uint8=>double, which is probably why it is only reading the first 8 bits, but not all 32. Try float32 instead.