Spatial Mapping Setting on camera receiver

Hello!
I’m running both sender and receiver scripts from github and I’m trying to get the ZED Spatial Mapping on the receiver.

From what I’ve trying, there are different view modes already working on the codebase (RIGHT, LEFT GRAY, RIGHT GRAY, SIDE BY SIDE). But on the DEPTH, CONFIDENCE and NORMALS view modes i get the following error

[Grab] Depth or confidence map view asked but depth map not computed (MODE_NONE)
INVALID FUNCTION PARAMETERS in sl::ERROR_CODE sl:: Camera::retrieveImage(sl::Mat&, sl::VIEW, sl::MEM, sl::Resolution)

So what I’m asking is:

  1. How can I fix the error I’m getting
  2. Is there a way to use a spatial mapping view just like the depth one

Thanks!

Hi @Rengo,

The issue your are experiencing is due to the fact that the initParameters.depth_mode is set to DEPTH_MODE::NONE in the receiver sample. In order to activate the depth compute, you have to set it to another value, for example ULTRA or NEURAL modes.

To facilitate development, I would like to mention that the spatial mapping sample already supports input from a stream as a command line argument, in particular these lines here: zed-sdk/spatial mapping/spatial mapping/cpp/src/main.cpp at master · stereolabs/zed-sdk · GitHub

This means that you can run the script as a receiver like this:

./ZED_Spatial_Mapping X.X.X.X:xxxx

Simply set the IP and port of your sender and this should work!

After messing around with the code samples I also found that! Thanks for the help!