![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
A reading from hardware, or computed from other sensors. More...
#include <Sensor.hpp>
Public Member Functions | |
| Sensor ()=default | |
| Sensor (const Sensor &)=delete | |
| Sensor & | operator= (const Sensor &)=delete |
| Sensor (Sensor &&)=delete | |
| Sensor & | operator= (Sensor &&)=delete |
| virtual | ~Sensor ()=default |
| T | get () |
| The current reading. The last good value while disconnected. | |
| T | delta () |
| Change since the previous snapshot (covers several ticks if nobody read in between). | |
| virtual bool | connected () const =0 |
Protected Member Functions | |
| virtual T | raw () const =0 |
| This tick's reading from the source; the last good value while disconnected. May restart after a reconnect. | |
| virtual std::uint32_t | epoch () const |
| Increments every time the source reconnects. Readings across a reconnect are not comparable. | |
A reading from hardware, or computed from other sensors.
One object per physical source, shared by reference by everything that uses it; nothing a consumer does changes what another sees. A consumer that needs its own zero uses a SensorView.
Subclasses implement raw(), connected() and, if the source can restart, epoch().
|
default |
|
delete |
|
delete |
|
virtualdefault |
|
nodiscardpure virtual |
Implemented in rz::InertialSensor, rz::RotationSensor, rz::SimulationSensor< T >, and rz::TrackingWheel.
|
inlinenodiscard |
Change since the previous snapshot (covers several ticks if nobody read in between).
|
inlinenodiscardprotectedvirtual |
Increments every time the source reconnects. Readings across a reconnect are not comparable.
Reimplemented in rz::InertialSensor, rz::RotationSensor, and rz::SimulationSensor< T >.
|
inlinenodiscard |
The current reading. The last good value while disconnected.
|
delete |
|
delete |
|
nodiscardprotectedpure virtual |
This tick's reading from the source; the last good value while disconnected. May restart after a reconnect.
Implemented in rz::InertialSensor, rz::RotationSensor, rz::SimulationSensor< T >, and rz::TrackingWheel.