Hanging disableSpatialMapping()


Zed SDK version: 4.0.8

I have noticed an issue when calling disableSpatialMapping() where it hangs. It happens almost every time when the camera is in SVO mode. The SVO file I am reproducing with has been recorded as HD720, 60fps. I have been able to reproduce the hang twice in live camera feed mode but it’s definitely not as frequent. The live feed mode was also in HD720, 60fps.

I couldn’t find anything in the docs that outlined a specific parameter I need to enable/assign for it to not hang. Would appreciate any help. Thank you so much.

Hi @dko

Thanks for the report.
After quick tests, I haven’t been able to reproduce it on my side, so I need more details.

  • Firstly, when you say it hangs, it hangs indefinitely, right? It can hang for some seconds, it’s the time it takes to cleanly free resources, but it shouldn’t be more.
  • Does it happen with other resolution/framerates?
  • Can you provide me with a C++ sample that reproduces the issue? It may be that we’re not using the same parameters.
  • Can I refer to the ZED Diagnostic you sent previously (same computer and camera)? If not, please send a new one.

Thank you for getting back to me.

  1. Yes, it hangs for at least 1 minute. I stopped counting after that.
  2. For live feed mode, I’ve only tested with HD720, 60fps since the ZED API docs states that you want to use higher fps for best results. For SVO, I’ve tested with HD2K, 15fps and HD1080, 30fps.
  3. I unfortunately cannot provide you with any specific sample code. However, these are the parameters for enableSpatialMapping(). I’ve used the same same parameters for live feed and all the SVO combinations listed above.
sl::SpatialMappingParameters parms;
parms.range_meter = 5.0f;
parms.resolution_meter = 0.03f;
parms.save_texture = true;
parms.max_memory_usage = 1024;
parms.use_chunk_only = true;
parms.reverse_vertex_order = false;
  1. Yes, I’m on the same system (camera + computer) so the ZED Diagnostic file from last time should be the same.

Hi @dko

I’m struggling to reproduce the issue.
Does it happen if you use the spatial mapping sample from the SDK and just add zed.disableSpatialMapping(); at this line: Spatial Mapping Sample ?

What depth mode were you using?

  1. I added zed.disableSpatialMapping(); to the sample code and passed in my test SVO file. It doesn’t seem to hang.
  2. I was using Performance for the depth mode.


We need to reproduce the issue to track it down if it’s linked to the SDK.
The most straightforward way to do it would be with a sample reproducing the issue.

  • Did you also add your spatial mapping parameters to the sample (and only them)?
  • If you could share more details on the implementation if we were not on the public forums, we can take the discussion to support@stereolabs.com and continue there (just mention this post, I’ll find it). Even pseudo-code would help (though not ideal).
  1. Yes, I changed the parameters in the sample project to the exact same spatial mapping parameters we are using in our project.
  2. Sure, let’s continue externally. Thank you.