OpenEV
Extending OpenCV to event-based vision
Loading...
Searching...
No Matches
davis.hpp
Go to the documentation of this file.
1
6#ifndef OPENEV_DEVICES_DAVIS_HPP
7#define OPENEV_DEVICES_DAVIS_HPP
8
10#include "openev/containers/vector.hpp"
12#include <stdint.h>
13#include <vector>
14
15namespace ev {
19class Davis : public AbstractCamera {
20public:
21 constexpr static uint32_t DEFAULT_INTERVAL = 20000;
22 constexpr static uint32_t DEFAULT_EXPOSURE = 6500;
23
25 Davis();
26 Davis(const Davis &) = delete;
27 Davis(Davis &&) noexcept = delete;
28 Davis &operator=(const Davis &) = delete;
29 Davis &operator=(Davis &&) noexcept = delete;
37 BiasValue getBias(const uint8_t name) const;
38
45 bool setBias(const uint8_t name, const BiasValue &value);
46
51 void enableDvs(bool state);
52
58 void setDvsTimeInterval(uint32_t usec);
59
65 void setDvsEventsPerPacket(uint32_t n);
66
71 void enableAps(bool state);
72
77 void setApsTimeInterval(uint32_t usec);
78
83 void setExposure(uint32_t exposure);
84
89 void enableImu(bool state);
90
96 bool getData(Vector &events) override;
97
103 bool getData(Queue &events) override;
104
110 bool getData(StampedMat &frame);
111
117 bool getData(StampedMatVector &frames);
118
124 bool getData(StampedMatQueue &frames);
125
131 bool getData(Imu &imu);
132
138 bool getData(ImuVector &imu);
139
145 bool getData(ImuQueue &imu);
146
153 bool getData(Vector &events, StampedMat &frame);
154
161 bool getData(Vector &events, StampedMatVector &frames);
162
169 bool getData(Queue &events, StampedMatQueue &frames);
170
177 bool getData(Vector &events, Imu &imu);
178
185 bool getData(Vector &events, ImuVector &imu);
186
193 bool getData(Queue &events, ImuQueue &imu);
194
202 bool getData(Vector &events, StampedMat &frame, Imu &imu);
203
211 bool getData(Vector &events, StampedMatVector &frame, ImuVector &imu);
212
220 bool getData(Queue &events, StampedMatQueue &frame, ImuQueue &imu);
221
231 void getEventRaw(std::vector<uint64_t> &data);
232
244 std::size_t getEventRaw(uint64_t *data, const bool allow_realloc = true);
245
246private:
247 template <typename T1, typename T2, typename T3>
248 void getData_([[maybe_unused]] T1 *dvs, [[maybe_unused]] T2 *aps, [[maybe_unused]] T3 *imu);
249
250 void init() override;
251};
252
253} // namespace ev
254
255#endif // OPENEV_DEVICES_DAVIS_HPP
Abstract camera device driver.
This is an auxiliary class. This class cannot be instanced.
Definition abstract-camera.hpp:117
This class extends AbstractCamera to operate with DAVIS event cameras. DAVIS cameras offer events (DV...
Definition davis.hpp:19
void enableDvs(bool state)
Enable DVS.
Definition davis.cpp:75
void enableAps(bool state)
Enable APS.
Definition davis.cpp:89
void setDvsEventsPerPacket(uint32_t n)
Set DVS maximum number of events per transmission.
Definition davis.cpp:84
bool setBias(const uint8_t name, const BiasValue &value)
Set the bias value associated with the given name.
Definition davis.cpp:71
void setDvsTimeInterval(uint32_t usec)
Set DVS maximum time interval between subsequent transmissions.
Definition davis.cpp:79
bool getData(Vector &events) override
Get DVS data.
Definition davis.cpp:107
void enableImu(bool state)
Enable IMU.
Definition davis.cpp:101
BiasValue getBias(const uint8_t name) const
Retrieve the bias value associated with the given name.
Definition davis.cpp:67
void setExposure(uint32_t exposure)
Set APS exposure time.
Definition davis.cpp:97
void getEventRaw(std::vector< uint64_t > &data)
Retrieve raw event data.
Definition davis.cpp:298
void setApsTimeInterval(uint32_t usec)
Set APS maximum time interval between subsequent transmissions.
Definition davis.cpp:93
This class extends std::queue to implement event queues. For more information, please refer here.
Definition queue.hpp:35
This class extends cv::Mat to include timestamp.
Definition abstract-camera.hpp:53
This class extends std::vector to implement event vectors. For more information, please refer here.
Definition vector.hpp:36
Queue container for basic event structures.
Definition abstract-camera.hpp:35
This struct is used to store IMU data from a DAVIS event camera.
Definition abstract-camera.hpp:91