diff options
Diffstat (limited to 'src/camera')
| -rw-r--r-- | src/camera/icamera.h | 4 | ||||
| -rw-r--r-- | src/camera/veyeimx287m.cpp | 19 | ||||
| -rw-r--r-- | src/camera/veyeimx287m.h | 25 |
3 files changed, 48 insertions, 0 deletions
diff --git a/src/camera/icamera.h b/src/camera/icamera.h index 545daf9..1fa0d18 100644 --- a/src/camera/icamera.h +++ b/src/camera/icamera.h @@ -49,6 +49,10 @@ public: [[nodiscard]] virtual bool set_gain(const float value) = 0; [[nodiscard]] virtual std::optional<float> get_gain() = 0; + [[nodiscard]] virtual bool set_triggerExposureDelay(const std::chrono::microseconds us) = 0; + [[nodiscard]] virtual std::optional<const std::chrono::microseconds> get_triggerExposureDelay() + = 0; + [[nodiscard]] virtual bool getImage(Image *image) = 0; [[nodiscard]] virtual std::shared_ptr<Image> getImage() = 0; diff --git a/src/camera/veyeimx287m.cpp b/src/camera/veyeimx287m.cpp index 1301c66..2a06a72 100644 --- a/src/camera/veyeimx287m.cpp +++ b/src/camera/veyeimx287m.cpp @@ -397,6 +397,25 @@ std::optional<float> VeyeIMX287m::get_gain() return *value * 10; } +bool VeyeIMX287m::set_triggerExposureDelay(const std::chrono::microseconds us) +{ + using namespace veye::imx287m; + return m_i2c->write(static_cast<uint16_t>(Register::Trigger_Exp_Delay), us.count()); +} + +std::optional<const std::chrono::microseconds> VeyeIMX287m::get_triggerExposureDelay() +{ + using namespace veye::imx287m; + + const auto value = m_i2c->read(static_cast<uint32_t>(Register::Trigger_Exp_Delay)); + + if (!value) { + return {}; + } + + return std::chrono::microseconds{*value}; +} + bool VeyeIMX287m::openCam() { m_cam_fd = open(videoDevice, O_RDWR); diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h index b875bb7..3a73cd2 100644 --- a/src/camera/veyeimx287m.h +++ b/src/camera/veyeimx287m.h @@ -25,6 +25,28 @@ class i2c; class HttpServer; +/* + * start calibration + * - send move zRange/16384 mm + * - wait StepDelay, ignore all pixels + * - collect 10 (64?) profiles + * - dump profiles + */ + +/*! + * \brief The VeyeIMX287m class - control and receive data from VEYE IMX287 + * camera + * \todo + * - implement `trgnum` - The number of image frames output by one trigger signal + * in trigger mode. Might be helpful in calibration mode + * - implement `trgfilter_enable` - for rising/falling edge support + * - implement `trgexp_delay` - Exposure delay, i.e. the time to turn on the + * Strobe signal in advance. The difference between trgexp_delay and trgdelay, + * see manual for details. (which manual?) + * - implement UDP streams, http is a bit slow even over 1GbE + * - implement roi + * - blcmode/blacklevel? (does it work in this camera?) + */ class VeyeIMX287m : public ICamera { constexpr static char videoDevice[] = "/dev/video0"; @@ -63,6 +85,9 @@ public: bool set_gain(const float value) override; std::optional<float> get_gain() override; + bool set_triggerExposureDelay(const std::chrono::microseconds us) override; + std::optional<const std::chrono::microseconds> get_triggerExposureDelay() override; + public: /*! * \brief processedCounter - count of images processed in current second. |
