001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.wpilibj;
006
007/** Robot state utility functions. */
008public final class RobotState {
009  /**
010   * Returns true if the robot is disabled.
011   *
012   * @return True if the robot is disabled.
013   */
014  public static boolean isDisabled() {
015    return DriverStation.isDisabled();
016  }
017
018  /**
019   * Returns true if the robot is enabled.
020   *
021   * @return True if the robot is enabled.
022   */
023  public static boolean isEnabled() {
024    return DriverStation.isEnabled();
025  }
026
027  /**
028   * Returns true if the robot is E-stopped.
029   *
030   * @return True if the robot is E-stopped.
031   */
032  public static boolean isEStopped() {
033    return DriverStation.isEStopped();
034  }
035
036  /**
037   * Returns true if the robot is in teleop mode.
038   *
039   * @return True if the robot is in teleop mode.
040   */
041  public static boolean isTeleop() {
042    return DriverStation.isTeleop();
043  }
044
045  /**
046   * Returns true if the robot is in autonomous mode.
047   *
048   * @return True if the robot is in autonomous mode.
049   */
050  public static boolean isAutonomous() {
051    return DriverStation.isAutonomous();
052  }
053
054  /**
055   * Returns true if the robot is in test mode.
056   *
057   * @return True if the robot is in test mode.
058   */
059  public static boolean isTest() {
060    return DriverStation.isTest();
061  }
062
063  private RobotState() {}
064}