RoboSense-LiDAR / ros_rslidar

ROS drvier for RS-LiDAR-16 and RS-LiDAR-32
Other
173 stars 116 forks source link

Why do we add NAN points instead of just skipping them? #28

Closed facontidavide closed 4 years ago

facontidavide commented 5 years ago

I am referring to this part of the code.... https://github.com/RoboSense-LiDAR/ros_rslidar/blob/master/rslidar_pointcloud/src/rawdata.cc#L873-L882

Wouldn't be easier and more efficient to just skip the point ad, for instance, the Velodyne drive does?

This might be related to issue #27, since people might rely on the index of the point to determine the ring and removing the NAN points might be an issue for them.

YoshuaNava commented 4 years ago

Hi @facontidavide

I think the Velodyne guys were actually going in this direction. Adding NaN to non-existent points in a point cloud is a way of "ordering the point cloud" (possible next steps -> matrix representation -> image compression). Ordered point clouds enable computations to run row and column-wise from scratch, and the size of each dataframe can be computed in advance.

An applied example: the multi-scan registration part of loam_velodyne, or a big chunk of LeGo-LOAM are just ordering the point cloud, to reach the point where they know what's the neighborhood of each point for which they'll compute the smoothness coefficient.

Hope this helps.

Yoshua

facontidavide commented 4 years ago

ok. I guess it might be an acceptable tradeoff...