Class DriverStationWrapper

java.lang.Object
me.nabdev.pathfinding.utilities.DriverStationWrapper

public class DriverStationWrapper extends Object
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 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

      public static Optional<edu.wpi.first.wpilibj.DriverStation.Alliance> 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