summaryrefslogtreecommitdiff
path: root/src/camera
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-02-26 16:33:12 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-02-26 16:33:12 +0100
commita688e436f03309d5813b68a375f694412018ca0b (patch)
tree8a5cdbb170fbb8417de42a09832d2eaf527ff61e /src/camera
parent1664027209ea3b8eb327b7755e4111577e66a2ee (diff)
add sync moveSteps
Diffstat (limited to 'src/camera')
-rw-r--r--src/camera/icamera.h4
-rw-r--r--src/camera/veyeimx287m.cpp19
-rw-r--r--src/camera/veyeimx287m.h25
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.