EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
VL53L8CX_Device.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <chrono>
13#include <future>
14#include <memory>
15#include <vector>
16
18#include "sensorring/device/hardware/vl53l8cx/VL53L8CX_Params.hpp"
22#include "sensorring/platform/SensorringExport.hpp"
23
24namespace eduart {
25
26namespace device {
27
28class VL53L8CX_DeviceImpl;
29
34class SENSORRING_EXPORT VL53L8CX_Device : public BaseDevice {
35public:
42 VL53L8CX_Device(VL53L8CX_Params params, com::ComInterfaceID interface, unsigned int idx);
45
50 const VL53L8CX_Params& getParams() const;
51
56 std::pair<const measurement::TofMeasurement&, DeviceState> getLatestMeasurement() const;
61 std::pair<const measurement::TofMeasurement&, DeviceState> getLatestTransformedMeasurement() const;
62
63 // std::future<bool> requestTofMeasurementAsync(std::chrono::milliseconds timeout);
64 // std::future<bool> fetchTofMeasurementAsync(std::chrono::milliseconds timeout);
71 static std::future<bool> requestTofMeasurementAsync(const std::vector<VL53L8CX_Device*>& devices, std::chrono::milliseconds timeout);
78 static std::future<bool> fetchTofMeasurementAsync(const std::vector<VL53L8CX_Device*>& devices, std::chrono::milliseconds timeout);
79
80private:
86 void comCallback(const com::ComEndpoint source, const std::vector<uint8_t>& data) override;
87
88 void onResetSensorState() override;
89 void onClearDataFlag() override;
90
91 friend class VL53L8CX_DeviceImpl;
92 std::unique_ptr<VL53L8CX_DeviceImpl> _impl;
93};
94
95} // namespace device
96
97} // namespace eduart
Base device combining IDevice and BaseSensor with device ID and state.
Interface type definition.
Collection of math functions.
Structures for ToF measurements.
Uniquely identifies a communication endpoint by its string ID.
Definition ComEndpoint.hpp:25
BaseDevice(DeviceID id, com::ComInterface *interface, com::ComEndpoint target, bool enable)
Constructs the device with the given ID, communication interface, endpoint, and enable flag.
static std::future< bool > fetchTofMeasurementAsync(const std::vector< VL53L8CX_Device * > &devices, std::chrono::milliseconds timeout)
Fetch Time-of-Flight measurements asynchronously from a set of devices.
std::pair< const measurement::TofMeasurement &, DeviceState > getLatestTransformedMeasurement() const
Get the most recent transformed measurement and current sensor state.
static std::future< bool > requestTofMeasurementAsync(const std::vector< VL53L8CX_Device * > &devices, std::chrono::milliseconds timeout)
Request Time-of-Flight measurements asynchronously on a set of devices.
std::pair< const measurement::TofMeasurement &, DeviceState > getLatestMeasurement() const
Get the most recent measurement and current sensor state.
VL53L8CX_Device(VL53L8CX_Params params, com::ComInterfaceID interface, unsigned int idx)
Construct a new VL53L8CX device instance.
const VL53L8CX_Params & getParams() const
Get the sensor parameters used to configure this device.
Definition ComInterfaceID.hpp:32
Parameter structure of the Time-of-Flight sensor of a sensor board.
Definition VL53L8CX_Params.hpp:18