RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::SimulationController Class Referencefinal

A controller whose sticks and buttons are set by a test or simulation. Read like a real one, each tick. More...

#include <SimulationController.hpp>

Inheritance diagram for rz::SimulationController:
rz::Controller rz::Component

Public Member Functions

 SimulationController ()
void setStick (Stick stick, double value)
void setButton (Button button, bool down)
void setConnected (bool connected)
Public Member Functions inherited from rz::Controller
double stick (Stick stick) const
 How far the stick is pushed, from -1 to 1. Right and up are positive.
bool held (Button button) const
 Whether the button is down.
bool pressed (Button button) const
 Whether the button went down this tick.
bool connected () const
Task nextPress (Button button)
 Waits for the next press of button, in a later tick than this one. Checked at estimatorsUpdated.
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.

Additional Inherited Members

Public Types inherited from rz::Controller
enum class  Stick : std::uint8_t { LeftX , LeftY , RightX , RightY }
enum class  Button : std::uint8_t {
  L1 , L2 , R1 , R2 ,
  Up , Down , Left , Right ,
  X , B , Y , A
}
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.
Static Public Attributes inherited from rz::Controller
static constexpr std::size_t STICK_COUNT = 4
static constexpr std::size_t BUTTON_COUNT = 12
Protected Member Functions inherited from rz::Controller
 Controller (std::string_view name)
Protected Member Functions inherited from rz::Component
 Component (std::string_view name)

Detailed Description

A controller whose sticks and buttons are set by a test or simulation. Read like a real one, each tick.

Constructor & Destructor Documentation

◆ SimulationController()

rz::SimulationController::SimulationController ( )
inline

Member Function Documentation

◆ setButton()

void rz::SimulationController::setButton ( Button button,
bool down )
inline

◆ setConnected()

void rz::SimulationController::setConnected ( bool connected)
inline

◆ setStick()

void rz::SimulationController::setStick ( Stick stick,
double value )
inline

The documentation for this class was generated from the following file: