How to save raw point cloud and Spatial Mapping output as PLY files with ZED 2i

Hi Stereolabs team,

Following up on my previous post titled “Question about ZED 2i point cloud, positional tracking, and overlaying external gas sensor data”, I would like to ask for some help with the first simple step of my workflow.

Before I overlay external sensor data onto the reconstructed 3D map, I first want to confirm how to obtain and save:

  1. the raw point cloud from the ZED 2i camera, and
  2. the fused spatial mapping output from the Spatial Mapping module.

My questions are:

  1. What is the simplest way to retrieve the raw point cloud data from the ZED SDK?
  2. How can I save the raw point cloud as a PLY file?
  3. How can I enable the Spatial Mapping module and save the fused spatial map as a PLY file?
  4. For my robot mapping use case, should I use FUSED_POINT_CLOUD instead of MESH if I want to overlay sensor data later?
  5. Is there a simple Python or C++ example that shows how to save both the camera trajectory and the fused spatial map?

At this stage, I only want to confirm that I can successfully save the point cloud and spatial mapping data first. After that, I will move on to overlaying external gas sensor data onto the 3D map.

Thank you very much for your help.

Best regards,
Hong Wei