DvsenseDriver  1.0.3
The SDK for dvsense products.
Loading...
Searching...
No Matches
dvsense::DvsCamera Class Referenceabstract

Interface class for DVS cameras. More...

#include <DvsCamera.hpp>

Public Member Functions

 DvsCamera (CameraDescription cameraDesc)
 Constructor.
 
virtual const bool isConnected ()=0
 Check if the camera is connected.
 
const CameraDescription getDvsDesc ()
 Get camera description.
 
virtual uint32_t addEventsStreamHandleCallback (EventsStreamHandleCallback cb)=0
 Add a callback function to handle events.
 
virtual bool removeEventsStreamHandleCallback (uint32_t callback_id)=0
 Remove a callback function by id.
 
virtual uint32_t addTriggerInCallback (DvsTriggerInCallback cb)=0
 Add a callback function to handle events.
 
virtual bool removeTriggerInCallback (uint32_t callback_id)=0
 Remove a callback function by id.
 
virtual bool getNextBatch (Event2DVector &event_batch)=0
 Get the next batch of events Before using the getNextBatch function, you need to use setBatchEventNum to set the number of events you need to fetch, or setAccumulateEventsTime to set the interval at which you need to fetch the events.
 
virtual void setBatchEventsNum (uint64_t n)=0
 Set the number of events to be fetched.
 
virtual void setBatchEventsTime (TimeStamp n)=0
 Set the time interval at which events are fetched.
 
virtual int start ()=0
 Start the camera.
 
virtual int stop ()=0
 Stop the camera.
 
virtual int startRecording (std::string file_path)=0
 Start recording events.
 
virtual void setFileCacheTime (uint16_t sec)
 
virtual int stopRecording ()=0
 Stop recording events.
 
virtual uint16_t getWidth ()=0
 Get the Width of the camera sensor.
 
virtual uint16_t getHeight ()=0
 Get the Height of the camera sensor.
 
virtual void setStatisticInfoCallback (DsStatisticInfoCallback cb)=0
 set the callback function to get the statistic information
 
const std::vector< ToolInfogetAllToolsInfo ()
 Get all the tools information.
 
const ToolInfo getToolInfo (ToolType type)
 Get the tool information.
 
const std::shared_ptr< CameraToolgetTool (ToolType type)
 Get the tool.
 

Protected Member Functions

virtual int init ()=0
 When a camera is opened, it should be initialized.
 

Protected Attributes

CameraDescription cameraDesc_
 Get the camera description.
 
std::map< ToolType, std::shared_ptr< CameraTool > > tools_
 

Detailed Description

Interface class for DVS cameras.

Constructor & Destructor Documentation

◆ DvsCamera()

dvsense::DvsCamera::DvsCamera ( CameraDescription cameraDesc)

Constructor.

Parameters
cameraDesccamera description

Member Function Documentation

◆ isConnected()

virtual const bool dvsense::DvsCamera::isConnected ( )
pure virtual

Check if the camera is connected.

Returns
true if connected, otherwise false

◆ getDvsDesc()

const CameraDescription dvsense::DvsCamera::getDvsDesc ( )
inline

Get camera description.

Returns
CameraDescription

◆ addEventsStreamHandleCallback()

virtual uint32_t dvsense::DvsCamera::addEventsStreamHandleCallback ( EventsStreamHandleCallback cb)
pure virtual

Add a callback function to handle events.

Parameters
cbcallback function
Returns
callback id With id you can removeEventsStreamHandleCallback

◆ removeEventsStreamHandleCallback()

virtual bool dvsense::DvsCamera::removeEventsStreamHandleCallback ( uint32_t callback_id)
pure virtual

Remove a callback function by id.

Parameters
callback_id
Returns
true if removed successfully
false if there is no callback function with the corresponding id in the callback function list.

◆ addTriggerInCallback()

virtual uint32_t dvsense::DvsCamera::addTriggerInCallback ( DvsTriggerInCallback cb)
pure virtual

Add a callback function to handle events.

Parameters
cbcallback function
Returns
callback id With id you can removeEventsStreamHandleCallback

◆ removeTriggerInCallback()

virtual bool dvsense::DvsCamera::removeTriggerInCallback ( uint32_t callback_id)
pure virtual

Remove a callback function by id.

Parameters
callback_id
Returns
true if removed successfully
false if there is no callback function with the corresponding id in the callback function list.

◆ getNextBatch()

virtual bool dvsense::DvsCamera::getNextBatch ( Event2DVector & event_batch)
pure virtual

Get the next batch of events Before using the getNextBatch function, you need to use setBatchEventNum to set the number of events you need to fetch, or setAccumulateEventsTime to set the interval at which you need to fetch the events.

Parameters
event_batch
Returns
true if fetched successfully
false if there is no event to fetch

◆ setBatchEventsNum()

virtual void dvsense::DvsCamera::setBatchEventsNum ( uint64_t n)
pure virtual

Set the number of events to be fetched.

Parameters
nnumber of events

◆ setBatchEventsTime()

virtual void dvsense::DvsCamera::setBatchEventsTime ( TimeStamp n)
pure virtual

Set the time interval at which events are fetched.

Parameters
ninterval in microseconds

◆ start()

virtual int dvsense::DvsCamera::start ( )
pure virtual

Start the camera.

Returns
int 0 if success, otherwise return error code

◆ stop()

virtual int dvsense::DvsCamera::stop ( )
pure virtual

Stop the camera.

Returns
int 0 if success, otherwise return error code

◆ startRecording()

virtual int dvsense::DvsCamera::startRecording ( std::string file_path)
pure virtual

Start recording events.

Parameters
file_path
Returns
int 0 if success, otherwise return error code

◆ setFileCacheTime()

virtual void dvsense::DvsCamera::setFileCacheTime ( uint16_t sec)
inlinevirtual

◆ stopRecording()

virtual int dvsense::DvsCamera::stopRecording ( )
pure virtual

Stop recording events.

Returns
int 0 if success, otherwise return error code

◆ getWidth()

virtual uint16_t dvsense::DvsCamera::getWidth ( )
pure virtual

Get the Width of the camera sensor.

Returns
uint16_t

◆ getHeight()

virtual uint16_t dvsense::DvsCamera::getHeight ( )
pure virtual

Get the Height of the camera sensor.

Returns
uint16_t

◆ setStatisticInfoCallback()

virtual void dvsense::DvsCamera::setStatisticInfoCallback ( DsStatisticInfoCallback cb)
pure virtual

set the callback function to get the statistic information

Parameters
cbcallback function

◆ getAllToolsInfo()

const std::vector< ToolInfo > dvsense::DvsCamera::getAllToolsInfo ( )

Get all the tools information.

Returns
std::vector<ToolInfo> information of all tools

◆ getToolInfo()

const ToolInfo dvsense::DvsCamera::getToolInfo ( ToolType type)

Get the tool information.

Parameters
typetool type
Returns
ToolInfo information of the tool

◆ getTool()

const std::shared_ptr< CameraTool > dvsense::DvsCamera::getTool ( ToolType type)

Get the tool.

Parameters
typetool type
Returns
std::shared_ptr<CameraTool> tool

◆ init()

virtual int dvsense::DvsCamera::init ( )
protectedpure virtual

When a camera is opened, it should be initialized.

Returns
0 if success, otherwise return error code

Member Data Documentation

◆ cameraDesc_

CameraDescription dvsense::DvsCamera::cameraDesc_
protected

Get the camera description.

Returns
CameraDescription

◆ tools_

std::map<ToolType, std::shared_ptr<CameraTool> > dvsense::DvsCamera::tools_
protected