naurril / SUSTechPOINTS

3D Point Cloud Annotation Platform for Autonomous Driving
GNU General Public License v3.0
785 stars 206 forks source link

Wierd view when annotation nuScenes #105

Open HoYinTam opened 1 year ago

HoYinTam commented 1 year ago

Thank you for your great work! I was testing with nuScene by directly copying some nuScene lidar data to example/lidar. As is shown below, the view of point cloud is wierd when selecting the nuScenes frame. image

Is there any extra operation when loading nuScenes files?

naurril commented 1 year ago

For .bin file, we follow KITTI format (float32: x,y,z,intensity), but nuscenes lidar bin file is different (float32: x,y,z,intensity,ring), you need to change the parsing code as follows or transform the bin file. https://github.com/naurril/SUSTechPOINTS/blob/522d1daef1e829f433cada6f420189ab3daee249/public/js/lib/PCDLoader.js#L130 to

    for (let row = 0; row < data.byteLength / (4 * 5); row += 1) {
      position.push(dataview.getFloat32(row * 20 + 0, this.littleEndian));
      position.push(dataview.getFloat32(row * 20 + 4, this.littleEndian));
      position.push(dataview.getFloat32(row * 20 + 8, this.littleEndian));
      intensity.push(dataview.getFloat32(row * 20 + 12, this.littleEndian));
    }

as described here