I hope you guys doing well I have a LiDAR which is Livox Mid 70. Which have a scan pattern like this. scan_pattern, which is depends on the time and create the whole scene.
I used ros to fetch the data from a perticular topic and create the numpy array.
def callback(data):
pc = rNp.numpify(data)
points = np.zeros((pc.shape[0], 4))
points[:,0]=pc['x']
points[:,1]=pc['y']
points[:,2]=pc['z']
points[:,3]=pc['intensity']
po = np.array(points, dtype=np.float32)
Then I create a (x, y) array which is contains X and Y coordinates of that pointcloud data and try to scale it like this:
p = (arr/np.max(arr)*255).astype(np.uint8) #arr = (x, y) numpy array
But unfortunately it's not giving me any understandable picture
Then I tried the ros command:
rosrun pcl_ros convert_pointcloud_to_image input:=/livox/lidar output:=/img
but the error msg is:
[ERROR] [1651119689.192807544]: Input point cloud is not organized, ignoring!
I saw some technique on matlab i.e. pcorganize, but to use this, I need to give it some parameters like
params = lidarParameters(sensorName,horizontalResolution) params = lidarParameters(verticalResolution,verticalFoV,horizontalResolution) params = lidarParameters(verticalBeamAngles,horizontalResolution) params = lidarParameters(___,HorizontalFoV=horizontalFoV)
But this Lidar don't have any horizontal or vertical resolution, beam angles so may be I can't use this function to organized this pcl data.
My question:
- How to organize these unorganized pcl data and create image from it?
- Is it possible to view this image from cv2.imshow()?