DvsenseDriver  1.1.4
The SDK for dvsense products.
Loading...
Searching...
No Matches
dvsense::FusionCamera Class Referenceabstract

Interface class for DVS cameras. More...

#include <FusionCamera.hpp>

Public Member Functions

 FusionCamera (CameraDescription cameraDesc)
 Constructor.
 
virtual const bool isConnected ()=0
 Check if the camera is connected.
 
const CameraDescription getDescription ()
 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 addApsFrameCallback (FrameCallback cb)=0
 Add a callback function to handle aps data.
 
virtual bool removeApsFrameCallback (uint32_t callback_id)=0
 Remove a callback function by id.
 
virtual uint32_t addSyncSignalCallback (DvsTriggerInCallback cb)=0
 Add a callback function to handle trigger in signal.
 
virtual bool removeSyncSignalCallback (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 (STREAM_TYPE type=FUSION_STREAM)=0
 Start the camera.
 
virtual int stop (STREAM_TYPE type=FUSION_STREAM)=0
 Stop the camera.
 
virtual int destroy ()=0
 
virtual int startRecording (std::string file_path, std::string file_name, STREAM_TYPE stream_type=FUSION_STREAM)=0
 Start recording events.
 
virtual int stopRecording (STREAM_TYPE stream_type=FUSION_STREAM)=0
 Stop recording events.
 
virtual uint16_t getWidth (STREAM_TYPE type=DVS_STREAM)=0
 Get the Width of the camera sensor.
 
virtual uint16_t getHeight (STREAM_TYPE type=DVS_STREAM)=0
 Get the Height of the camera sensor.
 
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.
 
virtual void setStatisticInfoCallback (DsStatisticInfoCallback cb)
 set the callback function to get the statistic information
 
virtual bool writeCalibrationFile (std::string file_path)=0
 
virtual bool readCalibrationParam (CalibratorParameters &param)=0
 
virtual bool getFirmwareVersion (std::string &version)=0
 

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

◆ FusionCamera()

dvsense::FusionCamera::FusionCamera ( CameraDescription cameraDesc)
inline

Constructor.

Parameters
cameraDesccamera description

Member Function Documentation

◆ isConnected()

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

Check if the camera is connected.

Returns
true if connected, otherwise false

◆ getDescription()

const CameraDescription dvsense::FusionCamera::getDescription ( )
inline

Get camera description.

Returns
CameraDescription

◆ addEventsStreamHandleCallback()

virtual uint32_t dvsense::FusionCamera::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::FusionCamera::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.

◆ addApsFrameCallback()

virtual uint32_t dvsense::FusionCamera::addApsFrameCallback ( FrameCallback cb)
pure virtual

Add a callback function to handle aps data.

Parameters
cbcallback function
Returns
callback id With id you can removeApsFrameCallback

◆ removeApsFrameCallback()

virtual bool dvsense::FusionCamera::removeApsFrameCallback ( 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.

◆ addSyncSignalCallback()

virtual uint32_t dvsense::FusionCamera::addSyncSignalCallback ( DvsTriggerInCallback cb)
pure virtual

Add a callback function to handle trigger in signal.

Parameters
cbcallback function
Returns
callback id With id you can removeTriggerInCallback

◆ removeSyncSignalCallback()

virtual bool dvsense::FusionCamera::removeSyncSignalCallback ( 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::FusionCamera::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::FusionCamera::setBatchEventsNum ( uint64_t n)
pure virtual

Set the number of events to be fetched.

Parameters
nnumber of events

◆ setBatchEventsTime()

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

Set the time interval at which events are fetched.

Parameters
ninterval in microseconds

◆ start()

virtual int dvsense::FusionCamera::start ( STREAM_TYPE type = FUSION_STREAM)
pure virtual

Start the camera.

Returns
int 0 if success, otherwise return error code

◆ stop()

virtual int dvsense::FusionCamera::stop ( STREAM_TYPE type = FUSION_STREAM)
pure virtual

Stop the camera.

Returns
int 0 if success, otherwise return error code

◆ destroy()

virtual int dvsense::FusionCamera::destroy ( )
pure virtual

◆ startRecording()

virtual int dvsense::FusionCamera::startRecording ( std::string file_path,
std::string file_name,
STREAM_TYPE stream_type = FUSION_STREAM )
pure virtual

Start recording events.

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

◆ stopRecording()

virtual int dvsense::FusionCamera::stopRecording ( STREAM_TYPE stream_type = FUSION_STREAM)
pure virtual

Stop recording events.

Returns
int 0 if success, otherwise return error code

◆ getWidth()

virtual uint16_t dvsense::FusionCamera::getWidth ( STREAM_TYPE type = DVS_STREAM)
pure virtual

Get the Width of the camera sensor.

Returns
uint16_t

◆ getHeight()

virtual uint16_t dvsense::FusionCamera::getHeight ( STREAM_TYPE type = DVS_STREAM)
pure virtual

Get the Height of the camera sensor.

Returns
uint16_t

◆ getAllToolsInfo()

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

Get all the tools information.

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

◆ getToolInfo()

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

Get the tool information.

Parameters
typetool type
Returns
ToolInfo information of the tool

◆ getTool()

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

Get the tool.

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

◆ setStatisticInfoCallback()

virtual void dvsense::FusionCamera::setStatisticInfoCallback ( DsStatisticInfoCallback cb)
inlinevirtual

set the callback function to get the statistic information

Parameters
cbcallback function

◆ writeCalibrationFile()

virtual bool dvsense::FusionCamera::writeCalibrationFile ( std::string file_path)
pure virtual

◆ readCalibrationParam()

virtual bool dvsense::FusionCamera::readCalibrationParam ( CalibratorParameters & param)
pure virtual

◆ getFirmwareVersion()

virtual bool dvsense::FusionCamera::getFirmwareVersion ( std::string & version)
pure virtual

◆ init()

virtual int dvsense::FusionCamera::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::FusionCamera::cameraDesc_
protected

Get the camera description.

Returns
CameraDescription

◆ tools_

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