![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
V5 Inertial Sensor, read as a heading, counterclockwise positive seen from above (ENU). More...
#include <InertialSensor.hpp>
Public Member Functions | |
| InertialSensor (std::uint8_t port) | |
| bool | connected () const override |
| bool | calibrating () const |
| Public Member Functions inherited from rz::Device | |
| std::uint8_t | port () const noexcept |
| bool | deviceConnected () const noexcept |
| Whether this tick's read succeeded. | |
| std::uint32_t | deviceEpoch () const noexcept |
| Increments on every (re)connection. | |
| Public Member Functions inherited from rz::Component | |
| Component (const Component &)=delete | |
| Component & | operator= (const Component &)=delete |
| Component (Component &&)=delete | |
| Component & | operator= (Component &&)=delete |
| virtual | ~Component () |
| std::string_view | name () const noexcept |
| Used in log and error messages. | |
| Public Member Functions inherited from rz::Sensor< Rotation > | |
| Sensor ()=default | |
| Sensor & | operator= (const Sensor &)=delete |
| virtual | ~Sensor ()=default |
| Rotation | get () |
| The current reading. The last good value while disconnected. | |
| Rotation | delta () |
| Change since the previous snapshot (covers several ticks if nobody read in between). | |
Protected Member Functions | |
| Rotation | raw () const override |
| This tick's reading from the source; the last good value while disconnected. May restart after a reconnect. | |
| std::uint32_t | epoch () const override |
| Increments every time the source reconnects. Readings across a reconnect are not comparable. | |
| Protected Member Functions inherited from rz::Device | |
| Device (std::uint8_t port, std::string_view kind) | |
| ~Device () override | |
| Protected Member Functions inherited from rz::Component | |
| Component (std::string_view name) | |
Additional Inherited Members | |
| Static Public Member Functions inherited from rz::Device | |
| static void | validatePorts () |
| Throws std::runtime_error if two devices are constructed on the same port. | |
| Static Public Member Functions inherited from rz::Component | |
| static Task | runAll () |
| Runs the loop of every component constructed so far, in construction order, until cancelled. rz::robot runs it; tests without rz::robot run it alongside their script. | |
V5 Inertial Sensor, read as a heading, counterclockwise positive seen from above (ENU).
The sensor finds which way is up while calibrating, so it can be mounted in any of its six orientations.
Calibration starts automatically when the sensor connects (and again after a reconnect) and takes about two seconds. While calibrating, connected() is false and delta() is zero.
|
explicit |
|
nodiscard |
|
nodiscardoverridevirtual |
Implements rz::Sensor< Rotation >.
|
inlinenodiscardoverrideprotectedvirtual |
Increments every time the source reconnects. Readings across a reconnect are not comparable.
Reimplemented from rz::Sensor< Rotation >.
|
nodiscardoverrideprotectedvirtual |
This tick's reading from the source; the last good value while disconnected. May restart after a reconnect.
Implements rz::Sensor< Rotation >.