DvsenseDriver  1.1.4
The SDK for dvsense products.
Loading...
Searching...
No Matches
FusionCamera.hpp
1#ifndef FUSION_CAMERA_HPP
2#define FUSION_CAMERA_HPP
3
4#include "DvsenseHal/camera/DvsCameraUtils.hpp"
5#include "DvsenseHal/EventStream/RawEventStreamFormat.hpp"
6#include "DvsenseBase/EventBase/EventTypes.hpp"
7#include "DvsenseBase/ApsBase/ApsTypes.h"
8#include "DvsenseBase/Utils/TypeUtils.hpp"
9#include "DvsenseHal/camera/tools/CameraTool.h"
10
11#ifdef _WIN32
12#define DVSENSE_API __declspec(dllexport)
13#else
14#define DVSENSE_API
15#endif // _WIN32
16namespace dvsense
17{
18
19 class DvsCameraManager;
25 class DVSENSE_API FusionCamera
26 {
27 private:
28 friend DvsCameraManager;
29
30 public:
38 {
39 cameraDesc_ = cameraDesc;
40 };
41
48 virtual const bool isConnected() = 0;
49
57 {
58 return cameraDesc_;
59 }
60
69 virtual uint32_t addEventsStreamHandleCallback(EventsStreamHandleCallback cb) = 0;
70
81 virtual bool removeEventsStreamHandleCallback(uint32_t callback_id) = 0;
82
91 virtual uint32_t addApsFrameCallback(FrameCallback cb) = 0;
92
103 virtual bool removeApsFrameCallback(uint32_t callback_id) = 0;
104
113 virtual uint32_t addSyncSignalCallback(DvsTriggerInCallback cb) = 0;
114
125 virtual bool removeSyncSignalCallback(uint32_t callback_id) = 0;
141 virtual bool getNextBatch(Event2DVector &event_batch) = 0;
142
149 virtual void setBatchEventsNum(uint64_t n) = 0;
150
157 virtual void setBatchEventsTime(TimeStamp n) = 0;
158
165 virtual int start(STREAM_TYPE type = FUSION_STREAM) = 0;
166
173 virtual int stop(STREAM_TYPE type = FUSION_STREAM) = 0;
174
175 virtual int destroy() = 0;
176
185 virtual int startRecording(std::string file_path, std::string file_name, STREAM_TYPE stream_type = FUSION_STREAM) = 0;
186
193 virtual int stopRecording(STREAM_TYPE stream_type = FUSION_STREAM) = 0;
194
201 virtual uint16_t getWidth(STREAM_TYPE type = DVS_STREAM) = 0;
202
209 virtual uint16_t getHeight(STREAM_TYPE type = DVS_STREAM) = 0;
210
217 const std::vector<ToolInfo> getAllToolsInfo();
218
227 const ToolInfo getToolInfo(ToolType type);
228
237 const std::shared_ptr<CameraTool> getTool(ToolType type);
238
245 virtual void setStatisticInfoCallback(DsStatisticInfoCallback cb) {};
246
247 virtual bool writeCalibrationFile(std::string file_path) = 0;
248
250
251 virtual bool getFirmwareVersion(std::string &version) = 0;
252
253 protected:
261
268 virtual int init() = 0;
269
270 // tools
271 std::map<ToolType, std::shared_ptr<CameraTool>> tools_;
272 };
273
274} // namespace dvsense
275
276#endif // FUSION_CAMERA_HPP
Camera Manager class.
Definition DvsCameraManager.hpp:36
Interface class for DVS cameras.
Definition FusionCamera.hpp:26
virtual int destroy()=0
virtual bool getNextBatch(Event2DVector &event_batch)=0
Get the next batch of events Before using the getNextBatch function, you need to use setBatchEventNum...
CameraDescription cameraDesc_
Get the camera description.
Definition FusionCamera.hpp:260
FusionCamera(CameraDescription cameraDesc)
Constructor.
Definition FusionCamera.hpp:37
virtual uint16_t getHeight(STREAM_TYPE type=DVS_STREAM)=0
Get the Height of the camera sensor.
const std::shared_ptr< CameraTool > getTool(ToolType type)
Get the tool.
virtual bool removeApsFrameCallback(uint32_t callback_id)=0
Remove a callback function by id.
virtual bool getFirmwareVersion(std::string &version)=0
virtual bool removeEventsStreamHandleCallback(uint32_t callback_id)=0
Remove a callback function by id.
virtual const bool isConnected()=0
Check if the camera is connected.
virtual int startRecording(std::string file_path, std::string file_name, STREAM_TYPE stream_type=FUSION_STREAM)=0
Start recording events.
virtual uint16_t getWidth(STREAM_TYPE type=DVS_STREAM)=0
Get the Width of the camera sensor.
virtual int start(STREAM_TYPE type=FUSION_STREAM)=0
Start the camera.
virtual bool readCalibrationParam(CalibratorParameters &param)=0
virtual void setStatisticInfoCallback(DsStatisticInfoCallback cb)
set the callback function to get the statistic information
Definition FusionCamera.hpp:245
virtual bool removeSyncSignalCallback(uint32_t callback_id)=0
Remove a callback function by id.
std::map< ToolType, std::shared_ptr< CameraTool > > tools_
Definition FusionCamera.hpp:271
virtual uint32_t addEventsStreamHandleCallback(EventsStreamHandleCallback cb)=0
Add a callback function to handle events.
virtual void setBatchEventsTime(TimeStamp n)=0
Set the time interval at which events are fetched.
const CameraDescription getDescription()
Get camera description.
Definition FusionCamera.hpp:56
virtual uint32_t addApsFrameCallback(FrameCallback cb)=0
Add a callback function to handle aps data.
virtual void setBatchEventsNum(uint64_t n)=0
Set the number of events to be fetched.
const ToolInfo getToolInfo(ToolType type)
Get the tool information.
const std::vector< ToolInfo > getAllToolsInfo()
Get all the tools information.
virtual int stopRecording(STREAM_TYPE stream_type=FUSION_STREAM)=0
Stop recording events.
virtual int stop(STREAM_TYPE type=FUSION_STREAM)=0
Stop the camera.
virtual uint32_t addSyncSignalCallback(DvsTriggerInCallback cb)=0
Add a callback function to handle trigger in signal.
virtual bool writeCalibrationFile(std::string file_path)=0
virtual int init()=0
When a camera is opened, it should be initialized.
Definition TypeUtils.hpp:9
uint64_t TimeStamp
Definition TypeUtils.hpp:10
STREAM_TYPE
Definition DvsCameraUtils.hpp:39
Definition TypeUtils.hpp:34
A struct to describe the camera information.
Definition DvsCameraUtils.hpp:68
The information of the tool, including the type, the parameter names and the description.
Definition ToolInfo.h:45