RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.driverstation.MatchState Class Reference

Static Public Member Functions

static double getMatchTime ()
static Optional< Alliance > getAlliance ()
static OptionalInt getLocation ()
static int getReplayNumber ()
static int getMatchNumber ()
static MatchType getMatchType ()
static String getEventName ()
static Optional< String > getGameData ()

Detailed Description

Provides access to match state information from the Driver Station.

Definition at line 12 of file MatchState.java.

Member Function Documentation

◆ getAlliance()

Optional< Alliance > org.wpilib.driverstation.MatchState.getAlliance ( )
static

Get the current alliance from the FMS.

If the FMS is not connected, it is set from the team alliance setting on the driver station.

Returns
The alliance (red or blue) or an empty optional if the alliance is invalid

Definition at line 43 of file MatchState.java.

◆ getEventName()

String org.wpilib.driverstation.MatchState.getEventName ( )
static

Get the event name from the FMS.

Returns
the event name

Definition at line 90 of file MatchState.java.

◆ getGameData()

Optional< String > org.wpilib.driverstation.MatchState.getGameData ( )
static

Get the game specific message from the FMS.

If the FMS is not connected, it is set from the game data setting on the driver station.

Returns
the game specific message

Definition at line 101 of file MatchState.java.

◆ getLocation()

OptionalInt org.wpilib.driverstation.MatchState.getLocation ( )
static

Gets the location of the team's driver station controls from the FMS.

If the FMS is not connected, it is set from the team alliance setting on the driver station.

Returns
the location of the team's driver station controls: 1, 2, or 3

Definition at line 54 of file MatchState.java.

◆ getMatchNumber()

int org.wpilib.driverstation.MatchState.getMatchNumber ( )
static

Get the match number from the FMS.

Returns
the match number

Definition at line 72 of file MatchState.java.

◆ getMatchTime()

double org.wpilib.driverstation.MatchState.getMatchTime ( )
static

Return the approximate match time. The FMS does not send an official match time to the robots, but does send an approximate match time. The value will count down the time remaining in the current period (auto or teleop). Warning: This is not an official time (so it cannot be used to dispute ref calls or guarantee that a function will trigger before the match ends).

When connected to the real field, this number only changes in full integer increments, and always counts down.

When the DS is in practice mode, this number is a floating point number, and counts down.

When the DS is in teleop or autonomous mode, this number returns -1.0.

Simulation matches DS behavior without an FMS connected.

Returns
Time remaining in current match period (auto or teleop) in seconds

Definition at line 32 of file MatchState.java.

◆ getMatchType()

MatchType org.wpilib.driverstation.MatchState.getMatchType ( )
static

Get the match type from the FMS.

Returns
the match type

Definition at line 81 of file MatchState.java.

◆ getReplayNumber()

int org.wpilib.driverstation.MatchState.getReplayNumber ( )
static

Get the replay number from the FMS.

Returns
the replay number

Definition at line 63 of file MatchState.java.


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