RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
Platform.hpp
1#pragma once
2#include "RaidZeroLib/api/Units/Units.hpp"
3
4namespace rz {
5
8
15class Platform {
16 public:
17 virtual ~Platform() = default;
18
20 [[nodiscard]] virtual Time now() const = 0;
21
23 virtual void sleepUntil(Time time) = 0;
24
26 [[nodiscard]] virtual CompetitionMode competitionMode() const = 0;
27};
28
29} // namespace rz
What the runtime needs from the outside world: a clock, a way to wait, and the competition mode.
Definition Platform.hpp:15
virtual ~Platform()=default
virtual Time now() const =0
Monotonic time.
virtual void sleepUntil(Time time)=0
Blocks until now() >= time. Returns immediately if that time has passed.
virtual CompetitionMode competitionMode() const =0
The mode field control is in right now.
CompetitionMode
What field control (or a competition switch) currently allows the robot to do.
Definition Platform.hpp:7
@ Driver
Definition Platform.hpp:7
@ Autonomous
Definition Platform.hpp:7
@ Disabled
Definition Platform.hpp:7
au::QuantityPointD< au::Seconds > Time
Definition Units.hpp:17
Definition DriverControl.hpp:11