EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
ThermalSensor.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <functional>
13
17#include "sensorring/platform/SensorringExport.hpp"
20
21namespace eduart {
22
23namespace sensorring {
24
25namespace device {
26
36class SENSORRING_EXPORT ThermalSensor : public Sensor {
37public:
40
47 ThermalSensor(DeviceID id, com::ComInterface* interface, com::ComEndpoint target);
48
50 ~ThermalSensor() override = default;
51
56 virtual const ThermalSensorParams& getParams() const = 0;
57
63
69 subscription::Subscription subscribe(std::function<void(const measurement::ThermalMeasurement&)> callback) { return _thermal_publisher.subscribe(std::move(callback)); }
70
76 virtual void publishMeasurement();
77
83 virtual bool startCalibration(unsigned int window) = 0;
84
89 virtual bool stopCalibration() = 0;
90
91protected:
92 measurement::ThermalMeasurement _latest_measurement;
94};
95
96} // namespace device
97
98} // namespace sensorring
99
100} // namespace eduart
Thread-safe, deadlock-free publish/subscribe template.
Base class for all sensor devices, adding measurement synchronisation to Device.
RAII wrapper pairing a SubscriberToken with its cancel function.
Structures for thermal measurements.
Parameter structure for the ThermalSensorParams.
Sensor(DeviceID id, com::ComInterface *interface, com::ComEndpoint target)
Construct the sensor with identity and communication link.
ThermalSensor(DeviceID id, com::ComInterface *interface, com::ComEndpoint target)
Construct a ThermalSensor with Device params.
virtual bool startCalibration(unsigned int window)=0
Start a thermal calibration over a sliding window of frames.
measurement::ThermalMeasurement MeasurementType
Measurement type produced by this sensor category.
Definition ThermalSensor.hpp:39
~ThermalSensor() override=default
Virtual destructor.
virtual bool stopCalibration()=0
Stop any ongoing thermal calibration sequence.
subscription::Publisher< const measurement::ThermalMeasurement & > _thermal_publisher
Publisher that delivers thermal measurements to subscribers.
Definition ThermalSensor.hpp:93
const measurement::ThermalMeasurement & getLatestMeasurement() const
Get the most recent measurement.
virtual const ThermalSensorParams & getParams() const =0
Get the current ThermalSensor parameters.
virtual void publishMeasurement()
Build a ThermalMeasurement from internal state and publish to all subscribers.
subscription::Subscription subscribe(std::function< void(const measurement::ThermalMeasurement &)> callback)
Subscribe to thermal measurements from this sensor.
Definition ThermalSensor.hpp:69
Generic thread-safe publisher that manages callback subscriptions.
Definition Publisher.hpp:37
Move-only RAII wrapper that pairs a SubscriberToken with an unsubscribe callable. Destroying a Subscr...
Definition Subscription.hpp:32
Uniquely identifies a communication endpoint as a (Direction, BoardAddress, DeviceId) tuple.
Definition ComEndpoint.hpp:37
Identifier for a device: type, human-readable name, and index.
Definition DeviceID.hpp:27
Parameter structure of the ThermalSensorParams.
Definition ThermalSensorParams.hpp:25
Structure for holding a measurement from a thermal sensor.
Definition ThermalMeasurement.hpp:79