Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 1 | // Copyright (c) FIRST and other WPILib contributors. |
| 2 | // Open Source Software; you can modify and/or share it under the terms of |
| 3 | // the WPILib BSD license file in the root directory of this project. |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 4 | |
| 5 | #include "frc/RobotState.h" |
| 6 | |
| 7 | #include "frc/DriverStation.h" |
| 8 | |
| 9 | using namespace frc; |
| 10 | |
| 11 | bool RobotState::IsDisabled() { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 12 | return DriverStation::IsDisabled(); |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | bool RobotState::IsEnabled() { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 16 | return DriverStation::IsEnabled(); |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | bool RobotState::IsEStopped() { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 20 | return DriverStation::IsEStopped(); |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | bool RobotState::IsOperatorControl() { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 24 | return IsTeleop(); |
| 25 | } |
| 26 | |
| 27 | bool RobotState::IsTeleop() { |
| 28 | return DriverStation::IsTeleop(); |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | bool RobotState::IsAutonomous() { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 32 | return DriverStation::IsAutonomous(); |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 33 | } |
| 34 | |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame^] | 35 | bool RobotState::IsTest() { |
| 36 | return DriverStation::IsTest(); |
| 37 | } |