Since I am relatively new to the field of computer vision and augmented reality, I started by looking at the official code examples (e.g., Visualizing a Point Cloud Using Scene Depth) and the documentation of ARKit, SceneKit, Metal and so. However, I still do not understand how to get the LiDAR data.
I found another thread in this forum (Exporting Point Cloud as 3D PLY Model) and the given solution works so far. However, I do not understand that code in detail, unfortunately. So I am not sure if this gives me really the raw LiDAR data or if some (internal) fusion with other (camera) data is happening, since I could not figure out where the data comes from exactly in the example.
Could you please give me some tips or code examples on how to work with/access the LiDAR data? It would be very much appreciated!
The particlesBuffer gets filled in the unprojectVertex function in Shaders.metal.However, I still cannot access the 3D-points. I also studied the first example again and basically what I would like to access are the 3D-points that are stored in the particlesBuffer. I just do not see how that buffer is filled in the example. Where/How does that happen?
Keep in mind that these points are just arbitrarily selected on a uniform grid. For your use case, it might make more sense to store the information necessary to unproject in the first place, enabling you to experiment with different grids. You would need to store the following information:
The sceneDepth.depthMap
The capturedImage
The sceneDepth.confidenceMap (if you want it)
The cameraIntrinsicsInversed matrix
The localToWorld matrix