![]() |
EduArt Sensor Ring Library 4.0.0
|
Base class for all devices in the SensorRing. More...
#include <Device.hpp>
Public Member Functions | |
| 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. | |
| Public Member Functions inherited from eduart::sensorring::ActionDispatcher | |
| void | setQueue (ActionQueue *queue) |
| void | clearQueue () |
| bool | isManaged () const |
| void | execute (Action action) |
| void | execute (std::string_view key, Action action) |
Protected Member Functions | |
| virtual void | comCallback (const com::ComEndpoint source, std::uint8_t command, const std::vector< std::uint8_t > &data)=0 |
Protected Attributes | |
| DeviceID | _id |
| unsigned int | _hw_idx |
| com::ComInterface * | _interface |
| const board::SensorBoardParams * | _board_params = nullptr |
| math::Pose | _offset |
| subscription::Subscription | _com_subscription |
Additional Inherited Members | |
| Static Public Member Functions inherited from eduart::sensorring::ActionDispatcher | |
| static void | globalExecute (Action action) |
Base class for all devices in the SensorRing.
Provides identity, communication, state tracking, pose handling and the action queue used by the state machine.
| eduart::sensorring::device::Device::Device | ( | DeviceID | id, |
| com::ComInterface * | interface, | ||
| com::ComEndpoint | target ) |
Construct the device with identity and communication link.
| [in] | id | Device identifier. |
| [in] | interface | Communication interface. |
| [in] | target | Communication endpoint this device listens to. |
|
virtual |
Apply post-reset runtime configuration for this device.
Reimplemented in eduart::sensorring::device::HTPA32_Device, eduart::sensorring::device::TMF8829_Device, and eduart::sensorring::device::WS2812b_Device.
| const board::SensorBoardParams * eduart::sensorring::device::Device::getBoardContext | ( | ) | const |
Return the board-level context pointer (non-owning).
| math::Pose eduart::sensorring::device::Device::getGlobalPose | ( | ) | const |
Compute and return the global pose in the ring coordinate frame.
| math::Pose eduart::sensorring::device::Device::getPoseOffset | ( | ) | const |
Return the stored pose offset relative to the board centre.
| void eduart::sensorring::device::Device::setBoardContext | ( | const board::SensorBoardParams * | board_params | ) |
Initialize board-level context pointer (non-owning).
| [in] | board_params | Pointer to board params. |
| void eduart::sensorring::device::Device::setDeviceIndex | ( | unsigned int | index | ) |
Reassign the logical device index (DeviceID.index) without changing the hardware index.
| [in] | index | New globally unique per-type index. |
| void eduart::sensorring::device::Device::setPoseOffset | ( | const math::Pose & | offset | ) |
Store a pose offset relative to the board centre.
| [in] | offset | Offset to apply on top of the board centre pose. |