Generate 3D point cloud

Hi,

I am trying to generate 3D point cloud data from the simulation. I found and is using Lidar point cloud plugin with UE 5. I also found a tutorial about how to build 3D point cloud data with the old version plugin(0.6, now is 0.8). However, one of the function is no longer available in the new version(create point cloud from data). I tried a lot of approaches but cannot make it. Can anyone give me some suggestions?
Here is the link for the tutorial:https://pointcloudplugin.com/building-new-point-cloud-v06

Thanks,

2 Likes

Hey @anonymous_user_369a217a

I uploaded an example in this thread:

Could you have a look?

1 Like

Hi @L1z4rD89 ,

Thank you for the help. Unfortunately the blueprint you offered uses the “create point cloud from data” function which is not available by now.

Hey, I use this version:

where it looks like this now:

image

and this was the old version:

image

Or do you mean something different?

Hi,

I found the issue.
I was trying to build a function to create point cloud and the “create lidar point cloud from data” function is not available while building other functions. It can only be added to the event graph(I guess).

Sorry for the confusion, and I am trying the function.
Thanks a lot.

You could have a look at LidarPointCloud.cpp in

\UE_5.0\Engine\Plugins\Enterprise\LidarPointCloud\Source\LidarPointCloudRuntime\Private

and look for ::CreateFromData

or -using blueprints- take the function from the EventGraph and try to copy it, maybe it is a bug.

Hi, I have tried the function. Is there anyway to output the cloud point as a file?

image

The file structure will be like:

-3.250075,-0.407996,-1.781549,255,0,0,255,-0.003922,-0.003922,-0.003922

which stands for

LocationX LocationY LocationZ Red Green Blue Alpha NormalX NormalY NormalZ```

Hi, I have another silly question, could you please show me how to instantiate the point cloud component?


I checked these values
image
but still get the error

Maybe I should give it a default value? But I cannot find any value to assign.

1 Like

Hey,

there are no silly questions. If you have a question, ask. :slight_smile:

So, you added the PointCloud as a variable. If you want to use it from the blueprint you are working on you could add it as a real component as shown in my example project:
image

Edit: This is for a LidarPointCloud variable.
image
image
image
image

For the LidarPointCloudComponent you need a component to set it:
image

image

This would also work with a component:
image

Hi, thank you for the help so far. I get another question.


I am trying to use the “Line Trace For Lidar Point Cloud” function to detect points in range and I do not know how to convert the hit structure to the point cloud point. Could you please give me another help?

You can drag off of the HIT result and use the Break command/node:

Hi, I tried the way, and the I feel the result is not right. Maybe there are still some misunderstandings.
For my understanding, the “Line Trace For Lidar Point Cloud” function takes origin(world location), direction(unit vector) and Radius(detection range). and it works like a ray cast system and will return the first object hit or null. Then, the Break… function can give me a point to add to the Point Array.
Thus, here is my approach



The second picture is the graph for the completed execution.
When I test it in the project. The system keep printing progress string
image
Which part of my understanding is wrong?
By the way, I just want to create Point Cloud data with a car in my project. Which similar to the lidars on vehicles in real world.

Hey,

so you have a mesh which you want to transfer into a point cloud?

nope, I want to use an object(car) as the center to generate point cloud data which records surrounding environment.

Ok, then you will need a slightly different approach (I think). Do you have an example scene?

Idea:

  • From your car create a SphereTrace to get the actors around the car
  • Try to get the meshes from these actors and from these meshes try to get the vertices (the locations)
  • Transform the locations to world
  • Add these locations to the point cloud

The functions we looked at before are used when you already have a point cloud or know which points to add. The LineTrace you used is for PointCloud data I think.

Addition:

Do you want to store the points and add more points to the cloud while driving around creating the whole map as PointCloud or just show what is around the car in a certain amount of time?

There are also other approaches like:

  • Create a PointCloud effect with materials
  • Create PointCloud effect with Niagara

Hi,


This is the example scene, I want to generate cloud point data center at the highlighted forklift.
I want to show what is around the car in a certain amount of time since the environment is dynamic.

Could you look at this example?:

Forklift.zip (1.1 MB)

Does this show what you had in mind?

2 Likes

Hi, thank you so much for creating the example project.

I went through the whole project and have some questions.

  1. What is the purpose for the Spline Index in BP_Forklift? I did not find the function to update the spline index.
  2. For the whole BP_Forklift, it will call traces every 0.1 second. Every time the traces function is called, it will clear points and add points from current frame. So If I want to export point cloud, I just need to convert LidarPoints to point cloud and export it. Am I right?