![]() |
DvsenseDriver
1.0.3
The SDK for dvsense products.
|
You can refer to the example program for the operation of the camera on and off. The following provides the explanation of different acquisition event interfaces.
Camera provides addEventsStreamHandleCallback interface, this interface can access to the flow of events in real time.
The following is a usage example:
Warning: When using the callback function interface, it is necessary to reduce the execution time of the callback function as much as possible, otherwise it will cause data accumulation and cause the program to crash.
You can add multiple callback functions using the addEventsStreamHandleCallback function, which will execute the callback functions you registered in the order they were registered when event stream is available. You can also record the ID number of the callback function using the return value of addEventsStreamHandleCallback, and then delete the callback function you no longer need by using the removeEventsStreamHandleCallback(id) function.
Camera provides getNextBatch interface, You can set the number or time to get the events, and then get the specified event data through the getNextBatch interface.
If you want to get a fixed number of events, you need to set the number of events you need through the setAccumulateEventsNum interface in advance,
also if you want to get a fixed time of events, you can set the interval you need through the setAccumulateEventsTime interface
Once the setup is complete, you need to retrieve the data by calling the getNextBatch interface
```cpp
std::threadget_events_thread= std::thread([&camera,&get_events,&stop_application]{
while (!stop_application) { if (camera->getNextBatch(get_events)) { // do something } } });