WPILibC++ 2024.3.2
|
Class to control a simulated driver station. More...
#include <frc/simulation/DriverStationSim.h>
Static Public Member Functions | |
static std::unique_ptr< CallbackStore > | RegisterEnabledCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on whether the DS is enabled. More... | |
static bool | GetEnabled () |
Check if the DS is enabled. More... | |
static void | SetEnabled (bool enabled) |
Change whether the DS is enabled. More... | |
static std::unique_ptr< CallbackStore > | RegisterAutonomousCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on whether the DS is in autonomous mode. More... | |
static bool | GetAutonomous () |
Check if the DS is in autonomous. More... | |
static void | SetAutonomous (bool autonomous) |
Change whether the DS is in autonomous. More... | |
static std::unique_ptr< CallbackStore > | RegisterTestCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on whether the DS is in test mode. More... | |
static bool | GetTest () |
Check if the DS is in test. More... | |
static void | SetTest (bool test) |
Change whether the DS is in test. More... | |
static std::unique_ptr< CallbackStore > | RegisterEStopCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on the eStop state. More... | |
static bool | GetEStop () |
Check if eStop has been activated. More... | |
static void | SetEStop (bool eStop) |
Set whether eStop is active. More... | |
static std::unique_ptr< CallbackStore > | RegisterFmsAttachedCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on whether the FMS is connected. More... | |
static bool | GetFmsAttached () |
Check if the FMS is connected. More... | |
static void | SetFmsAttached (bool fmsAttached) |
Change whether the FMS is connected. More... | |
static std::unique_ptr< CallbackStore > | RegisterDsAttachedCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on whether the DS is connected. More... | |
static bool | GetDsAttached () |
Check if the DS is attached. More... | |
static void | SetDsAttached (bool dsAttached) |
Change whether the DS is attached. More... | |
static std::unique_ptr< CallbackStore > | RegisterAllianceStationIdCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on the alliance station ID. More... | |
static HAL_AllianceStationID | GetAllianceStationId () |
Get the alliance station ID (color + number). More... | |
static void | SetAllianceStationId (HAL_AllianceStationID allianceStationId) |
Change the alliance station. More... | |
static std::unique_ptr< CallbackStore > | RegisterMatchTimeCallback (NotifyCallback callback, bool initialNotify) |
Register a callback on match time. More... | |
static double | GetMatchTime () |
Get the current value of the match timer. More... | |
static void | SetMatchTime (double matchTime) |
Sets the match timer. More... | |
static void | NotifyNewData () |
Updates DriverStation data so that new values are visible to the user program. More... | |
static void | SetSendError (bool shouldSend) |
Sets suppression of DriverStation::ReportError and ReportWarning messages. More... | |
static void | SetSendConsoleLine (bool shouldSend) |
Sets suppression of DriverStation::SendConsoleLine messages. More... | |
static int64_t | GetJoystickOutputs (int stick) |
Gets the joystick outputs. More... | |
static int | GetJoystickRumble (int stick, int rumbleNum) |
Gets the joystick rumble. More... | |
static void | SetJoystickButton (int stick, int button, bool state) |
Sets the state of one joystick button. More... | |
static void | SetJoystickAxis (int stick, int axis, double value) |
Gets the value of the axis on a joystick. More... | |
static void | SetJoystickPOV (int stick, int pov, int value) |
Gets the state of a POV on a joystick. More... | |
static void | SetJoystickButtons (int stick, uint32_t buttons) |
Sets the state of all the buttons on a joystick. More... | |
static void | SetJoystickAxisCount (int stick, int count) |
Sets the number of axes for a joystick. More... | |
static void | SetJoystickPOVCount (int stick, int count) |
Sets the number of POVs for a joystick. More... | |
static void | SetJoystickButtonCount (int stick, int count) |
Sets the number of buttons for a joystick. More... | |
static void | SetJoystickIsXbox (int stick, bool isXbox) |
Sets the value of isXbox for a joystick. More... | |
static void | SetJoystickType (int stick, int type) |
Sets the value of type for a joystick. More... | |
static void | SetJoystickName (int stick, std::string_view name) |
Sets the name of a joystick. More... | |
static void | SetJoystickAxisType (int stick, int axis, int type) |
Sets the types of Axes for a joystick. More... | |
static void | SetGameSpecificMessage (std::string_view message) |
Sets the game specific message. More... | |
static void | SetEventName (std::string_view name) |
Sets the event name. More... | |
static void | SetMatchType (DriverStation::MatchType type) |
Sets the match type. More... | |
static void | SetMatchNumber (int matchNumber) |
Sets the match number. More... | |
static void | SetReplayNumber (int replayNumber) |
Sets the replay number. More... | |
static void | ResetData () |
Reset all simulation data for the Driver Station. More... | |
Class to control a simulated driver station.
|
static |
Get the alliance station ID (color + number).
|
static |
Check if the DS is in autonomous.
|
static |
Check if the DS is attached.
|
static |
Check if the DS is enabled.
|
static |
Check if eStop has been activated.
|
static |
Check if the FMS is connected.
|
static |
Gets the joystick outputs.
stick | The joystick number |
|
static |
Gets the joystick rumble.
stick | The joystick number |
rumbleNum | Rumble to get (0=left, 1=right) |
|
static |
Get the current value of the match timer.
|
static |
Check if the DS is in test.
|
static |
Updates DriverStation data so that new values are visible to the user program.
|
static |
Register a callback on the alliance station ID.
callback | the callback that will be called whenever the alliance station changes |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on whether the DS is in autonomous mode.
callback | the callback that will be called on autonomous mode entrance/exit |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on whether the DS is connected.
callback | the callback that will be called whenever the DS connection changes |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on whether the DS is enabled.
callback | the callback that will be called whenever the enabled state is changed |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on the eStop state.
callback | the callback that will be called whenever the eStop state changes |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on whether the FMS is connected.
callback | the callback that will be called whenever the FMS connection changes |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on match time.
callback | the callback that will be called whenever match time changes |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Register a callback on whether the DS is in test mode.
callback | the callback that will be called whenever the test mode is entered or left |
initialNotify | if true, the callback will be run on the initial value |
|
static |
Reset all simulation data for the Driver Station.
|
static |
Change the alliance station.
allianceStationId | the new alliance station |
|
static |
Change whether the DS is in autonomous.
autonomous | the new value |
|
static |
Change whether the DS is attached.
dsAttached | the new value |
|
static |
Change whether the DS is enabled.
enabled | the new value |
|
static |
Set whether eStop is active.
eStop | true to activate |
|
static |
Sets the event name.
name | the event name |
|
static |
Change whether the FMS is connected.
fmsAttached | the new value |
|
static |
Sets the game specific message.
message | the game specific message |
|
static |
Gets the value of the axis on a joystick.
stick | The joystick number |
axis | The analog axis number |
value | The value of the axis on the joystick |
|
static |
Sets the number of axes for a joystick.
stick | The joystick number |
count | The number of axes on the indicated joystick |
|
static |
Sets the types of Axes for a joystick.
stick | The joystick number |
axis | The target axis |
type | The type of axis |
|
static |
Sets the state of one joystick button.
Button indexes begin at 1.
stick | The joystick number |
button | The button index, beginning at 1 |
state | The state of the joystick button |
|
static |
Sets the number of buttons for a joystick.
stick | The joystick number |
count | The number of buttons on the indicated joystick |
|
static |
Sets the state of all the buttons on a joystick.
stick | The joystick number |
buttons | The bitmap state of the buttons on the joystick |
|
static |
Sets the value of isXbox for a joystick.
stick | The joystick number |
isXbox | The value of isXbox |
|
static |
Sets the name of a joystick.
stick | The joystick number |
name | The value of name |
|
static |
Gets the state of a POV on a joystick.
stick | The joystick number |
pov | The POV number |
value | the angle of the POV in degrees, or -1 for not pressed |
|
static |
Sets the number of POVs for a joystick.
stick | The joystick number |
count | The number of POVs on the indicated joystick |
|
static |
Sets the value of type for a joystick.
stick | The joystick number |
type | The value of type |
|
static |
Sets the match number.
matchNumber | the match number |
|
static |
Sets the match timer.
matchTime | the new match time |
|
static |
Sets the match type.
type | the match type |
|
static |
Sets the replay number.
replayNumber | the replay number |
|
static |
Sets suppression of DriverStation::SendConsoleLine messages.
shouldSend | If false then messages will be suppressed. |
|
static |
Sets suppression of DriverStation::ReportError and ReportWarning messages.
shouldSend | If false then messages will be suppressed. |
|
static |
Change whether the DS is in test.
test | the new value |