as you can see… waitForEvents() it’s actually using the user specified timeout value 2000000000 (2-sec) for processing. STATUS_TIMEOUT has reported by waiting for 2-sec.
do you have capture events?
since it’s also a condition wait until at least one event is available.
The outputs “wait for events” and “wait for events done” are printed just before and after the call to waitForEvents. When you look at the timestamps, you see that the waitForEvents function call takes 10s to complete. This is because the trigger rate is this example is 1/10Hz. So it only exits the function because a new image (event) has arrived. The user provided timeout of two seconds is not used. Otherwise the “wait for events done” output should have been printed every two seconds.
in the beginning I thought it was waitForEvents() timeout being overwritten.
however, after debug results, it shows even this API taking user specified timeout value, such timeout (2-sec) is not used. (it’s expected to obtain STATUS_TIMEOUT output for every 2-sec)
so…
it’s contradiction between waitForEvents() timeout and enabelCamInfiniteTimeout=1.
by digging into the code.
there’s a thread created for running frame capture, it’s a condition wait until at least one event (SOF signal) is available. that’s why waitForEvents() API called when a new image (event) has arrived. (in every 10s)
this is by design.
I’m still not clear what’s your real use-case to “timeout” for every 2-sec with a 1/10Hz sensor.
is it the purpose for application to stay online and react immediately?
how about launch the application to capture a frame, and then shutdown the application?
it’s a condition wait until at least one event (SOF signal) is available. that’s why waitForEvents() API called when a new image (event) has arrived
So, is it somehow possible to extend this condtion somehow that the user provided timeout is used?
I’m still not clear what’s your real use-case to “timeout” for every 2-sec with a 1/10Hz sensor.
is it the purpose for application to stay online and react immediately?
how about launch the application to capture a frame, and then shutdown the application?
The use case is a camera triggered by an external trigger signal provider, e.g. a light barrier or a hardware button, where trigger signals can be fired at any time. So there is no fixed frame rate. The time span between two frame can be some milliseconds or even days. Therefore we need the enableCamInfiniteTimeout.
But we cannot set the timeout for waitForEvents() to infinite, because it would make the application unresponsive (e.g. when stopping the camera) if no hardware trigger event occurs. Therefore it would be nice when the timeout value provided using the API would be used. Then waitForEvents() would time out every two seconds and we could exit the loop if “stop” was requested. Currently, waitForEvents() blocks forever, so there is no way to exit the event reading loop.
The 1/10Hz are only in my test application to simulate the behavior.
it seems we do not get error events. Instead the queue is empty shortly before we get the Argus::EVENT_TYPE_CAPTURE_COMPLETE event. See logs with timestamps:
FYI, enabelcaminfinitetimeout has a common implementation apply to all the camera internal timeouts including waitForEvents(),
once set, it will override all the timeouts through out the driver.
hence,
if you expecting to override these, you may also create your own wrapper over the API, and create a separate thread to waitForEvents(), and trigger a condition to wait upon.
ok thanks. So it seems that there is currently no solution without wrapping the whole event handling outside. Are there any plans to fix this in future? I think it could also be done internally which would make the usage easier for customers. Otherwise it should at least be documented that the timeout parameter of waitForEvents() is not working with enableCamInfiniteTimeout.
I also don’t know how to wrap this. Even if I read the events in another thread, there is still no way to join this thread, because the call to waitForEvents never returns. Is there any way to stop the waiting?