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
9#include "openev/containers/queue.hpp"
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() override;
27 Davis(const Davis &) = delete;
28 Davis(Davis &&) noexcept = delete;
29 Davis &operator=(const Davis &) = delete;
30 Davis &operator=(Davis &&) noexcept = delete;
36 void start(void) override;
37
43 BiasValue getBias(const uint8_t name) const;
44
51 bool setBias(const uint8_t name, const BiasValue &value);
52
57 void enableDvs(bool state);
58
64 void setDvsTimeInterval(uint32_t usec);
65
71 void setDvsEventsPerPacket(uint32_t n);
72
77 void enableAps(bool state);
78
83 void setApsTimeInterval(uint32_t usec);
84
89 void setExposure(uint32_t exposure);
90
95 void enableImu(bool state);
96
102 bool getData(Vector &events) override;
103
109 bool getData(Queue &events) override;
110
116 bool getData(StampedMat &frame);
117
123 bool getData(StampedMatVector &frames);
124
130 bool getData(StampedMatQueue &frames);
131
137 bool getData(Imu &imu);
138
144 bool getData(ImuVector &imu);
145
151 bool getData(ImuQueue &imu);
152
159 bool getData(Vector &events, StampedMat &frame);
160
167 bool getData(Vector &events, StampedMatVector &frames);
168
175 bool getData(Queue &events, StampedMatQueue &frames);
176
183 bool getData(Vector &events, Imu &imu);
184
191 bool getData(Vector &events, ImuVector &imu);
192
199 bool getData(Queue &events, ImuQueue &imu);
200
208 bool getData(Vector &events, StampedMat &frame, Imu &imu);
209
217 bool getData(Vector &events, StampedMatVector &frame, ImuVector &imu);
218
226 bool getData(Queue &events, StampedMatQueue &frame, ImuQueue &imu);
227
237 void getEventRaw(std::vector<uint64_t> &data);
238
250 std::size_t getEventRaw(uint64_t *data, const bool allow_realloc = true);
251
252private:
253 bool dvsEnabled_{true};
254 bool apsEnabled_{true};
255 bool imuEnabled_{false};
256 template <typename T1, typename T2, typename T3>
257 void getData_([[maybe_unused]] T1 *dvs, [[maybe_unused]] T2 *aps, [[maybe_unused]] T3 *imu);
258};
259
260} // namespace ev
261
262#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 (D...
Definition davis.hpp:19
void enableDvs(bool state)
Enable DVS.
Definition davis.cpp:81
void enableAps(bool state)
Enable APS.
Definition davis.cpp:95
void setDvsEventsPerPacket(uint32_t n)
Set DVS maximum number of events per transmission.
Definition davis.cpp:90
bool setBias(const uint8_t name, const BiasValue &value)
Set the bias value associated with the given name.
Definition davis.cpp:77
void setDvsTimeInterval(uint32_t usec)
Set DVS maximum time interval between subsequent transmissions.
Definition davis.cpp:85
bool getData(Vector &events) override
Get DVS data.
Definition davis.cpp:112
void enableImu(bool state)
Enable IMU.
Definition davis.cpp:107
BiasValue getBias(const uint8_t name) const
Retrieve the bias value associated with the given name.
Definition davis.cpp:73
void setExposure(uint32_t exposure)
Set APS exposure time.
Definition davis.cpp:103
void getEventRaw(std::vector< uint64_t > &data)
Retrieve raw event data.
Definition davis.cpp:303
void setApsTimeInterval(uint32_t usec)
Set APS maximum time interval between subsequent transmissions.
Definition davis.cpp:99
void start(void) override
Starts device.
Definition davis.cpp:53
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
Definition abstract-camera.hpp:35
This struct is used to store IMU data from a DAVIS event camera.
Definition abstract-camera.hpp:91