DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Wait Conditions Detector Workflow
Note
SW Release Applicability: This tutorial is applicable to modules in NVIDIA DRIVE Software releases.

The following code snippet shows the general structure of a program that uses waitconditions detector to detect intersections, traffic lights and traffic signs.

Initialize WaitNet default parameters, WaitNet, detector parameters and then the detector.

dwWaitNetParams waitnetParams{};
dwWaitNet_initialize(&waitnetHandle, &waitnetParams, context);
dwWaitConditionsDetectorParams wcDetectorParams;
dwWaitConditionsDetector_initDefaultParams(&wcDetectorParams);
dwWaitConditionsDetector_initializeFromWaitNetNew(&wcDetectorHandle, waitnetHandle,
&wcDetectorParams, cam2Rig, calibratedCamObj, motionObj, context);

Then bind output and set cuda stream:

dwWaitConditionsDetectorOutput detectorOutput{};
dwIntersectionDetection detectedIntersections[DW_WAIT_CONDITIONS_DETECTOR_MAX_INTERSECTIONS];
intersectionsBuffer.buffer = detectedIntersections;
intersectionsBuffer.size = 0;
intersectionsBuffer.maxSize = DW_WAIT_CONDITIONS_DETECTOR_MAX_INTERSECTIONS;
detectorOutput.intersections = &intersectionsBuffer;
dwWaitConditionsDetector_bindOutput(&detectorOutput, wcDetectorHandle);
dwWaitConditionsDetector_setCUDAStream(cudaStream, wcDetectorHandle);

Detect intersections, traffic lights and traffic signs:

dwWaitConditionsDetector_inferDeviceAsync(&imageIn, imageNum, wcDetectorHandle);
dwWaitConditionsDetector_interpret(imageNum, wcDetectorHandle);

When finished, release the module handles:

dwWaitConditionsDetector_release(wcDetectorHandle);
dwWaitNet_release(waitnetHandle);

For more detailed workflow, please refer to the intersection detector sample: Intersection Detection Sample (WaitNet)