Base class for all sensor devices in the SensorRing.
More...
#include <Sensor.hpp>
|
| | Sensor (DeviceID id, com::ComInterface *interface, com::ComEndpoint target) |
| | Construct the sensor with identity and communication link.
|
|
std::future< bool > | measure (std::uint8_t sequence_number) |
|
std::future< bool > | fetch () |
| std::future< bool > | beginMeasurementWait () |
| | Begin an asynchronous wait for the next measurement trigger.
|
| void | setMeasurementReady (bool success) |
| | Satisfy the pending measurement-wait future.
|
| std::future< bool > | beginDataAvailableWait () |
| | Begin an asynchronous wait for new data to become available.
|
| void | setDataAvailableReady (bool success) |
| | Satisfy the pending data-available-wait future.
|
|
void | resetSensorState () |
| | Reset the device to its initialised state, clearing all error flags.
|
|
void | clearDataFlag () |
| | Clear the data-available flag so the device can accept the next measurement cycle.
|
| | Device (DeviceID id, com::ComInterface *interface, com::ComEndpoint target) |
| | Construct the device with identity and communication link.
|
|
DeviceID | getDeviceID () const |
| | Return the full device identifier (type + index).
|
|
unsigned int | getHwIdx () const |
| | Return the zero-based hardware board index on its bus (used for CAN addressing and protocol bitmasks).
|
| void | setDeviceIndex (unsigned int index) |
| | Reassign the logical device index (DeviceID.index) without changing the hardware index.
|
| virtual bool | configure () |
| | Apply post-reset runtime configuration for this device.
|
| void | setBoardContext (const board::SensorBoardParams *board_params) |
| | Initialize board-level context pointer (non-owning).
|
| const board::SensorBoardParams * | getBoardContext () const |
| | Return the board-level context pointer (non-owning).
|
| void | setPoseOffset (const math::Pose &offset) |
| | Store a pose offset relative to the board centre.
|
| math::Pose | getPoseOffset () const |
| | Return the stored pose offset relative to the board centre.
|
| math::Pose | getGlobalPose () const |
| | Compute and return the global pose in the ring coordinate frame.
|
|
void | setQueue (ActionQueue *queue) |
|
void | clearQueue () |
|
bool | isManaged () const |
|
void | execute (Action action) |
|
void | execute (std::string_view key, Action action) |
|
|
virtual bool | sendMeasurementRequest (std::uint8_t sequence_number)=0 |
|
virtual bool | sendMeasurementTransmissionRequest ()=0 |
|
virtual void | onResetSensorState () |
|
virtual void | onClearDataFlag () |
|
virtual void | comCallback (const com::ComEndpoint source, std::uint8_t command, const std::vector< std::uint8_t > &data)=0 |
|
|
static void | globalExecute (Action action) |
Base class for all sensor devices in the SensorRing.
Extends Device with promise-based measurement synchronisation and sensor state management used by the state machine scheduler.
◆ Sensor()
Construct the sensor with identity and communication link.
- Parameters
-
| [in] | id | Device identifier. |
| [in] | interface | Communication interface. |
| [in] | target | Communication endpoint this device listens to. |
◆ beginDataAvailableWait()
| std::future< bool > eduart::sensorring::device::Sensor::beginDataAvailableWait |
( |
| ) |
|
Begin an asynchronous wait for new data to become available.
- Returns
- Future that resolves to
true when data is available, or false on shutdown.
◆ beginMeasurementWait()
| std::future< bool > eduart::sensorring::device::Sensor::beginMeasurementWait |
( |
| ) |
|
Begin an asynchronous wait for the next measurement trigger.
- Returns
- Future that resolves to
true when the measurement trigger fires, or false on shutdown.
◆ setDataAvailableReady()
| void eduart::sensorring::device::Sensor::setDataAvailableReady |
( |
bool | success | ) |
|
Satisfy the pending data-available-wait future.
- Parameters
-
| [in] | success | true if data is ready, false on error. |
◆ setMeasurementReady()
| void eduart::sensorring::device::Sensor::setMeasurementReady |
( |
bool | success | ) |
|
Satisfy the pending measurement-wait future.
- Parameters
-
| [in] | success | true if the measurement succeeded, false on error. |
The documentation for this class was generated from the following file: