Continuing the discussion from How to use a common hardware trigger with multiple cameras:
General Information
- Product: C57-6-M
- Serial Number: 244888, 245218
- Ensenso SDK Version: 4.0.1502
- Operating System: Windows 10 64bit
- Data Attachments
-
Profiler log
tmp_NxTreeEdit20260427-12.zip (16.4 MB)
-
Problem / Question
As in the code below, we open two C57 cameras, specify hardware triggers for each, execute the Trigger and Retrieve commands, and then execute the ComputeDisparityMap command.
nxLibSetString(&error, "/Execute/Parameters/Cameras", m_serial);
nxLibSetString(&error, "/Execute/Command", "Open");
nxLibSetString(&error, "/Execute/Parameters/Cameras", m_serial2);
nxLibSetString(&error, "/Execute/Command", "Open");
nxLibSetString(&error, "/Execute/Parameters/Cameras", m_serial_C);
nxLibSetString(&error, "/Execute/Command", "Open");
nxLibWaitForType(&error, "/Execute/Command", NxLibItemTypeNull, 1);
nxLibSetString(&error, "/Execute/Parameters/Cameras", m_serial_C2);
nxLibSetString(&error, "/Execute/Command", "Open");
nxLibWaitForType(&error, "/Execute/Command", NxLibItemTypeNull, 1);
NxLibCommand trigger(cmdTrigger);
trigger.parameters()[itmSubset] = valAll;
trigger.execute();
NxLibCommand retrieve(cmdRetrieve);
retrieve.parameters()[itmTimeout] = -1;
retrieve.parameters()[itmCameras][0] = m_serial;
retrieve.parameters()[itmCameras][1] = m_serial2;
retrieve.execute(static_cast<bool>(false));
while (1) {
std::this_thread::sleep_for(std::chrono::microseconds(10));
if (retrieve.finished()) {
retrieve.assertSuccessful();
assert(retrieve.result()[m_serial][itmRetrieved].asBool());
assert(retrieve.result()[m_serial2][itmRetrieved].asBool());
bool rc2 = retrieve.result()[m_serial2][itmRetrieved].asBool();
if (rc2) {
break;
}
}
if(cancel){
retrieve.cancel();
while (true) {
if (retrieve.finished()) {
return(1);
}
}
}
}
retrieve.parameters()[itmTimeout] = 1000;
retrieve.parameters()[itmCameras][0] = m_serial_C;
retrieve.parameters()[itmCameras][1] = m_serial_C2;
retrieve.execute();
nxLibSetString(&error, "/Execute/Command", "ComputeDisparityMap");
nxLibWaitForType(&error, "/Execute/Command", NxLibItemTypeNull, 1);
nxLibSetString(&error, "/Execute/Command", "ComputePointMap");
nxLibWaitForType(&error, "/Execute/Command", NxLibItemTypeNull, 1);
//・・・
However, it takes more than a minute for the ComputeDisparityMap command to complete.
(We are waiting for a response with
nxLibWaitForType(&error, “/Execute/Command”, NxLibItemTypeNull, 1);)
Is there something wrong with how we are using it?
I am attaching the profile obtained at that time.
The single-camera version of the above code works normally.
Thank you in advance.
Best regards,
K.N,
