从无组织的典型扫描模式LIDAR生成图像,点云数据

发布于 2025-01-25 03:37:28 字数 1362 浏览 6 评论 0 原文

我希望你们一切都好 我有一个Livox Mid 70。具有这样的扫描模式。 scan_pattern ,这取决于时间并创建整个场景。

我使用ROS从perticular主题中获取数据并创建Numpy数组。

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)

然后,我创建了一个(x,y)数组,其中包含该点cloud数据的x和y坐标,并尝试像这样扩展它:

p = (arr/np.max(arr)*255).astype(np.uint8) #arr = (x, y) numpy array

但是不幸的是,它没有给我任何可理解的图片,

然后我尝试了ROS命令:

rosrun pcl_ros convert_pointcloud_to_image input:=/livox/lidar output:=/img

但是错误msg是:

[ERROR] [1651119689.192807544]: Input point cloud is not organized, ignoring!

我在Matlab IE PCorbanize上看到了一些技术,但是要使用此技术,我需要给它一些参数,例如

params = lidarParameters(sensOrname,horizo​​ntalresolution)params = LIDARPARAMETER(垂直分辨,垂直养殖,水平分辨率) params = lidarParameters(垂直贝方,水平分辨率) params = lidarParameters(___,hiforontalfov = hiforontalfov)

,但该激光雷达没有任何水平或垂直分辨率,梁角 因此,可能我不能使用此功能来组织此PCL数据。

我的问题:

  1. 如何组织这些无组织的PCL数据并从中创建图像?
  2. 是否可以从cv2.imshow()查看此图像?

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:

  1. How to organize these unorganized pcl data and create image from it?
  2. Is it possible to view this image from cv2.imshow()?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黯淡〆 2025-02-01 03:37:29

Answers:

  1. Buffer the PointCloud2 messages from LiDAR in a written node (best python), if it's needed (only when scan pattern needs time to run a whole scan for example 2s for a whole scan). Take a look at Velodyne LiDARs they don't need it, because there plane scans LiDARs, i.e. complete detailed image from the first second of running. As I mentioned it's only necessary, when your LiDAR has a Lissajous scan pattern (https://www.nature.com/articles/s41598-017-13634-3) or another, which needs the time to do a complete scene scan.

    Case 1: scan pattern needs the time: custom buffering time (1s, 2s or 4s...) - compared to your attached scan pattern). Then you have a whole scan.

    Case 2: scan pattern doesn't need any buffering time: rich detailed scan from beginning, normally buffering isn't necessary

    In the next step you should use this node:
    https://github.com/mjshiggins/ros-examples/blob/master/src/lidar/src/lidar_node.cpp

    This node takes your pointcloud2 message and generates a image from bird's eye view. I used this node in my thesis and change a few things in the for easier understanding and better solution. I could share this file with you or if you want to explore this node yourself and need help from time to time for example for changing LiDAR position, changing cell_resolution (zoom of the top view to your image), image color and so on. Also I add the coding of the Image color channels with given data from LiDAR: Intensity, Density, Height (only height coding in original code).

  2. With OpenCV you can look at this image as a opened window or visualize it as published topic in RViz.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文