Error with ZED_livelink_fusion with open a Fusion config file

Hello everyone,

I’m posting here since I encourter some difficulties to send bodies infos with multiple cams.

I’m trying to use several ZED camera in a Unreal Engine project. I’ve followed several tutorials.
First, I’ve tried with only one cam and the sender-mono C++ sample project. I got it working.
Now, I’m on the sender-multi-cam sample. At first, I can launch it, but when I add a json_config_filename, then I have a std::bad_alloc unhandled exception within the readFusionConfigurationFile function.

I have investigated a little further by creating my own config reading function.
It seems the error comes from the copy of sl::CommunicationParameters.
Indeed, when I try to create a new one and push it into a vector, I also get a bad_alloc error.

std::vector<sl::CommunicationParameters> comms;
sl::CommunicationParameters commTemp;
commTemp.setForSharedMemory();
comms.push_back(commTemp); // <-- Error here

I also get an error when I try to get the IP address of the communication.

sl::CommunicationParameters commTemp;
std::string ipaddress = "127.000.000.001";
commTemp.setForLocalNetwork(ipaddress, 2000);
commTemp.getIpAddress();   // <-- Error here

Some more info :
The configuration file have been created using ZED360.
The C++ project have been created using the CMake as introduise in this tutorial : Building a C++ Application on Windows - Stereolabs

I using :

  • CMake 3.30.2
  • Visual 2022
  • Cuda 12.6.20 (same problem with Cuda 12.1)
  • ZED SDK for cuda 12.1 v4.1.3
  • 2 cameras Zed 2i

I hope I’m clear enough and you have enough info to help. Otherwise, let me know.
Have a good day !

Hi Frédéric,

Is it possible to share your calibration file?
You can send it at support@stereolabs.com if you don’t want to share it publicly.

Thanks.

Benjamin Vallon

Hi Benjamin.

Here is my livelink config file ZEDFusionLiveLinkConfig.json:

{
  "StreamingParameters":
  {
    "connection_type": "MULTICAST",
    "ip": "192.168.1.1",
    "port": 2000,
    "send_bodies": true,
    "send_camera_pose": true
  },
  "InitParameters":
  {
    "resolution": "HD720",
    "fps": 30,
    "depth_mode": "ULTRA",
	  "grab_compute_capping_fps": 0
  },
  "BodyTrackingParameters":
  {
    "detection_model": "HUMAN_BODY_MEDIUM",
    "body_format": "BODY_38",
    "confidence": 50,
    "max_range": -1,
    "minimum_keypoints_threshold" : -1
  },
  "InitFusionParameters":
  {
    "json_config_filename": "SalleProd.json",
    "output_performance_metrics": true,
    "verbose": false
  },
  "BodyTrackingFusionParameters":
  {
    "skeleton_minimm_allowed_keypoints": 8,
    "skeleton_minimum_allowed_camera": -1,
    "skeleton_smoothing": 0.2
  }
}

and my calibration config file SalleProd.json:

{
    "31320106": {
        "input": {
            "zed": {
                "type": "USB_SERIAL",
                "configuration": "31320106"
            },
            "fusion": {
                "type": "INTRA_PROCESS"
            }
        },
        "world": {
            "rotation": [
                0.0,
                0.0,
                0.0
            ],
            "translation": [
                0.0,
                -1.4461945295333862,
                0.0
            ]
        }
    },
    "31941432": {
        "input": {
            "zed": {
                "type": "USB_SERIAL",
                "configuration": "31941432"
            },
			"fusion": {
                "type": "INTRA_PROCESS"
            }
        },
        "world": {
            "rotation": [
                0.013548195362091064,
                -1.3124895095825195,
                -0.01286797970533371
            ],
            "translation": [
                2.3973631858825684,
                -1.40902578830719,
                1.8409461975097656
            ]
        }
    }
}

Thanks!

I did not manage to reproduce your problem yet.
I’ll come back to you when I find something.

Thanks!

I did not manage to reproduce your problem yet.
I’ll come back to you when I find something.

[Discourse post]

Stereolabs Support

Ok. I found it.

Since you hadn’t any problem, then there was certainly something basic I did wrong.
Indeed. I was launching the project in Debug mode.
Now, everything works fine in RelWithDebInfo.

The mono sample prompt an error asking for non Debug mode, but the multi cam don’t.

Thank you for your help and for your time.

Solution : Be careful to test your project NOT in Debug mode.

1 Like

Oh, yes, good to know, thanks.

I updated the sample to not compile in Debug Mode, that will prevent that from happening in the future.
It was already the case for the single cam sample but not for the multi-cam one.

Thanks for the report.

Best regards,
Benjamin Vallon

I’m far to be a C++ expert. But why can’t the Debug mode be used ?

We don’t provide the debug lib of the ZED SDK, therefore you are running the sample in debug mode using binaries built in Release mode.

The problem is that the Debug and Release modes are not handling the memory exactly the same way, that why you were getting memory allocation errors.