Device wrapper for a VL53L8CX Time-of-Flight sensor on the sensorring bus.
More...
#include <VL53L8CX_Device.hpp>
|
| | VL53L8CX_Device (VL53L8CX_Params params, com::ComInterfaceID interface, unsigned int idx) |
| | Construct a new VL53L8CX device instance.
|
|
| ~VL53L8CX_Device () |
| | Destructor.
|
| const VL53L8CX_Params & | getParams () const |
| | Get the sensor parameters used to configure this device.
|
| std::pair< const measurement::TofMeasurement &, DeviceState > | getLatestMeasurement () const |
| | Get the most recent measurement and current sensor state.
|
| std::pair< const measurement::TofMeasurement &, DeviceState > | getLatestTransformedMeasurement () const |
| | Get the most recent transformed measurement and current sensor state.
|
| | BaseDevice (DeviceID id, com::ComInterface *interface, com::ComEndpoint target, bool enable) |
| | Constructs the device with the given ID, communication interface, endpoint, and enable flag.
|
| DeviceID | getDeviceID () const |
| | Returns the device identifier.
|
| void | setPoseOffset (const DevicePoseOffset &offset) |
| | Set the pose offset of this device relative to the board center.
|
| DevicePoseOffset | getPoseOffset () const |
| | Get the pose offset of this device relative to the board center.
|
| | BaseSensor (com::ComInterface *interface, com::ComEndpoint target, unsigned int idx, bool enable) |
| | Construct a base sensor and register it with the communication interface.
|
|
virtual | ~BaseSensor () |
| | Destructor.
|
| unsigned int | getIdx () const |
| | Get the index of this sensor instance.
|
| bool | getEnable () const |
| | Query if the sensor is currently enabled.
|
| void | setEnable (bool enable) |
| | Enable or disable the sensor.
|
| void | setPose (math::Vector3 translation, math::Vector3 rotation) |
| | Set the pose of the sensor in the common coordinate frame.
|
| void | resetSensorState () |
| | Reset error state and internal flags to nominal values.
|
|
void | clearDataFlag () |
| | Clear state for the next measurement cycle. Calls the sensor-specific hook onClearDataFlag().
|
| std::future< bool > | beginMeasurementWait () |
| | Start a measurement-wait cycle and return a future that will be set when the measurement is ready.
|
| std::future< bool > | beginDataAvailableWait () |
| | Start a data-available-wait cycle and return a future that will be set when new data is available.
|
|
| 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.
|
| 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.
|
|
|
class | VL53L8CX_DeviceImpl |
|
| void | setMeasurementReady (bool success) |
| | Set the result of the current measurement-wait cycle. Called from derived callbacks when ready.
|
| void | setDataAvailableReady (bool success) |
| | Set the result of the current data-available-wait cycle. Called from derived callbacks when "data available" is received.
|
| virtual void | comCallback (const com::ComEndpoint source, const std::vector< std::uint8_t > &data)=0 |
| | Handle an incoming communication message for this sensor.
|
|
DeviceState | _state |
| | Current lifecycle/runtime state.
|
|
DeviceID | _id |
| | Device identifier.
|
|
bool | _enable |
| | Whether the device is enabled.
|
| DevicePoseOffset | _pose_offset |
| | Pose offset of the device relative to the sensor board center.
|
|
unsigned int | _idx |
| | Index of this sensor instance within its group.
|
|
DeviceState | _error |
| | Current health state of the sensor.
|
|
com::ComInterface * | _interface |
| | Communication interface used to talk to the sensor.
|
|
math::Vector3 | _translation |
| | Translation of the sensor origin in the common coordinate frame.
|
|
math::Vector3 | _rotation |
| | Rotation of the sensor expressed as Euler angles in degrees.
|
|
math::Matrix3 | _rot_m |
| | Rotation matrix derived from the Euler angles.
|
|
bool | _enable_flag |
| | Flag indicating whether the sensor is enabled.
|
| std::mutex | _state_mutex |
|
std::optional< std::promise< bool > > | _measurement_promise |
| | Promise for the current measurement-wait cycle; set by callback, consumed by wait + get().
|
|
std::optional< std::promise< bool > > | _data_available_promise |
| | Promise for the current data-available-wait cycle; set by callback when "data available" is received.
|
| std::mutex | _promise_mutex |
|
subscription::Subscription | _com_subscription |
| | RAII subscription to the communication interface.
|
Device wrapper for a VL53L8CX Time-of-Flight sensor on the sensorring bus.
◆ VL53L8CX_Device()
Construct a new VL53L8CX device instance.
- Parameters
-
| [in] | params | Sensor configuration parameters. |
| [in] | interface | Communication interface used to talk to the device. |
| [in] | idx | Index of the sensor on the bus. |
◆ fetchTofMeasurementAsync()
| std::future< bool > eduart::device::VL53L8CX_Device::fetchTofMeasurementAsync |
( |
const std::vector< VL53L8CX_Device * > & | devices, |
|
|
std::chrono::milliseconds | timeout ) |
|
static |
Fetch Time-of-Flight measurements asynchronously from a set of devices.
- Parameters
-
| [in] | devices | Vector of devices to read from. |
| [in] | timeout | Maximum time to wait for completion. |
- Returns
- Future resolving to true when all fetches succeed.
◆ getLatestMeasurement()
Get the most recent measurement and current sensor state.
- Returns
- Pair of latest Time-of-Flight measurement and associated sensor state.
◆ getLatestTransformedMeasurement()
Get the most recent transformed measurement and current sensor state.
- Returns
- Pair of latest transformed Time-of-Flight measurement and associated sensor state.
◆ getParams()
| const VL53L8CX_Params & eduart::device::VL53L8CX_Device::getParams |
( |
| ) |
const |
Get the sensor parameters used to configure this device.
- Returns
- Reference to the internal VL53L8CX parameter struct.
◆ requestTofMeasurementAsync()
| std::future< bool > eduart::device::VL53L8CX_Device::requestTofMeasurementAsync |
( |
const std::vector< VL53L8CX_Device * > & | devices, |
|
|
std::chrono::milliseconds | timeout ) |
|
static |
Request Time-of-Flight measurements asynchronously on a set of devices.
- Parameters
-
| [in] | devices | Vector of devices to trigger. |
| [in] | timeout | Maximum time to wait for completion. |
- Returns
- Future resolving to true when all requests succeed.
The documentation for this class was generated from the following file: