Package me.nabdev.pathfinding.utilities
Class DriverStationWrapper
java.lang.Object
me.nabdev.pathfinding.utilities.DriverStationWrapper
A wrapper class for the DriverStation class that allows for the use of the
DriverStation class in an environment where wpiHalJNI is unavailable (I.E.
OxplorerGUI). Returns default values if -Dnohaljni=true is given to the JVM.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<edu.wpi.first.wpilibj.DriverStation.Alliance>
Returns the alliance that the driver station is on.static double
Returns whether the Driver Station is currently enabled.static boolean
Returns whether the Driver Station is currently enabled.static boolean
isTeleop()
Returns whether the Driver Station is currently enabled.
-
Constructor Details
-
DriverStationWrapper
public DriverStationWrapper()
-
-
Method Details
-
isAutonomous
public static boolean isAutonomous()Returns whether the Driver Station is currently enabled. False if HALJNI is disabled.- Returns:
- true if the Driver Station is currently enabled, false otherwise
-
isTeleop
public static boolean isTeleop()Returns whether the Driver Station is currently enabled. True if HALJNI is disabled.- Returns:
- true if the Driver Station is currently enabled, false otherwise
-
getMatchTime
public static double getMatchTime()Returns whether the Driver Station is currently enabled. False if HALJNI is disabled.- Returns:
- true if the Driver Station is currently enabled, false otherwise
-
getAlliance
Returns the alliance that the driver station is on. If HALJNI is disabled, returns an empty Optional.- Returns:
- the alliance that the driver station is on
-