![]() |
WPILibC++ 2025.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. | |
| static bool | GetEnabled () |
| Check if the DS is enabled. | |
| static void | SetEnabled (bool enabled) |
| Change whether the DS is enabled. | |
| static std::unique_ptr< CallbackStore > | RegisterAutonomousCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on whether the DS is in autonomous mode. | |
| static bool | GetAutonomous () |
| Check if the DS is in autonomous. | |
| static void | SetAutonomous (bool autonomous) |
| Change whether the DS is in autonomous. | |
| static std::unique_ptr< CallbackStore > | RegisterTestCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on whether the DS is in test mode. | |
| static bool | GetTest () |
| Check if the DS is in test. | |
| static void | SetTest (bool test) |
| Change whether the DS is in test. | |
| static std::unique_ptr< CallbackStore > | RegisterEStopCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on the eStop state. | |
| static bool | GetEStop () |
| Check if eStop has been activated. | |
| static void | SetEStop (bool eStop) |
| Set whether eStop is active. | |
| static std::unique_ptr< CallbackStore > | RegisterFmsAttachedCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on whether the FMS is connected. | |
| static bool | GetFmsAttached () |
| Check if the FMS is connected. | |
| static void | SetFmsAttached (bool fmsAttached) |
| Change whether the FMS is connected. | |
| static std::unique_ptr< CallbackStore > | RegisterDsAttachedCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on whether the DS is connected. | |
| static bool | GetDsAttached () |
| Check if the DS is attached. | |
| static void | SetDsAttached (bool dsAttached) |
| Change whether the DS is attached. | |
| static std::unique_ptr< CallbackStore > | RegisterAllianceStationIdCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on the alliance station ID. | |
| static HAL_AllianceStationID | GetAllianceStationId () |
| Get the alliance station ID (color + number). | |
| static void | SetAllianceStationId (HAL_AllianceStationID allianceStationId) |
| Change the alliance station. | |
| static std::unique_ptr< CallbackStore > | RegisterMatchTimeCallback (NotifyCallback callback, bool initialNotify) |
| Register a callback on match time. | |
| static double | GetMatchTime () |
| Get the current value of the match timer. | |
| static void | SetMatchTime (double matchTime) |
| Sets the match timer. | |
| static void | NotifyNewData () |
| Updates DriverStation data so that new values are visible to the user program. | |
| static void | SetSendError (bool shouldSend) |
| Sets suppression of DriverStation::ReportError and ReportWarning messages. | |
| static void | SetSendConsoleLine (bool shouldSend) |
| Sets suppression of DriverStation::SendConsoleLine messages. | |
| static int64_t | GetJoystickOutputs (int stick) |
| Gets the joystick outputs. | |
| static int | GetJoystickRumble (int stick, int rumbleNum) |
| Gets the joystick rumble. | |
| static void | SetJoystickButton (int stick, int button, bool state) |
| Sets the state of one joystick button. | |
| static void | SetJoystickAxis (int stick, int axis, double value) |
| Gets the value of the axis on a joystick. | |
| static void | SetJoystickPOV (int stick, int pov, int value) |
| Gets the state of a POV on a joystick. | |
| static void | SetJoystickButtons (int stick, uint32_t buttons) |
| Sets the state of all the buttons on a joystick. | |
| static void | SetJoystickAxisCount (int stick, int count) |
| Sets the number of axes for a joystick. | |
| static void | SetJoystickPOVCount (int stick, int count) |
| Sets the number of POVs for a joystick. | |
| static void | SetJoystickButtonCount (int stick, int count) |
| Sets the number of buttons for a joystick. | |
| static void | SetJoystickIsXbox (int stick, bool isXbox) |
| Sets the value of isXbox for a joystick. | |
| static void | SetJoystickType (int stick, int type) |
| Sets the value of type for a joystick. | |
| static void | SetJoystickName (int stick, std::string_view name) |
| Sets the name of a joystick. | |
| static void | SetJoystickAxisType (int stick, int axis, int type) |
| Sets the types of Axes for a joystick. | |
| static void | SetGameSpecificMessage (std::string_view message) |
| Sets the game specific message. | |
| static void | SetEventName (std::string_view name) |
| Sets the event name. | |
| static void | SetMatchType (DriverStation::MatchType type) |
| Sets the match type. | |
| static void | SetMatchNumber (int matchNumber) |
| Sets the match number. | |
| static void | SetReplayNumber (int replayNumber) |
| Sets the replay number. | |
| static void | ResetData () |
| Reset all simulation data for the Driver Station. | |
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.
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |
|
staticnodiscard |
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 |