is it guarantee that syncsensor with ScopedCudaEGLStreamFrameAcquire can get exact same instance with 0ms time lag?
hi nvidia/argus developer,
with below code, how can we guarantee that it is synchronized where the code is executed sequentially.
i don’t see any binding between camera 1&2 for master and slave or what ever it is.
btw, after captured, how to get raw image out from m_frame? and to display it by preview consumer, i found some example using NvNativeBuffer to grab the plane and then convert by opencv, but it is slow.
anyone can advise how to do fix DMA mapping without any copying or conversion and then can be used to publish via ROS.
thanks.
bool StereoDisparityConsumerThread::threadExecute() { CONSUMER_PRINT("Waiting for Argus producer to connect to left stream.\n"); m_leftStream->waitUntilConnected(); CONSUMER_PRINT("Waiting for Argus producer to connect to right stream.\n"); m_rightStream->waitUntilConnected(); CONSUMER_PRINT("Streams connected, processing frames.\n"); unsigned int histogramLeft[HISTOGRAM_BINS]; unsigned int histogramRight[HISTOGRAM_BINS]; while (true) { ScopedCudaEGLStreamFrameAcquire left(m_cuStreamLeft); ScopedCudaEGLStreamFrameAcquire right(m_cuStreamRight);
ScopedCudaEGLStreamFrameAcquire::ScopedCudaEGLStreamFrameAcquire(CUeglStreamConnection& connection) : m_connection(connection) , m_stream(NULL) , m_resource(0) { CUresult r = cuEGLStreamConsumerAcquireFrame(&m_connection, &m_resource, &m_stream, -1); if (r == CUDA_SUCCESS) { cuGraphicsResourceGetMappedEglFrame(&m_frame, m_resource, 0, 0); } }