2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2016-01-02 03:02:34 -08:00
|
|
|
|
2014-08-08 17:05:49 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
2025-11-07 20:00:05 -05:00
|
|
|
namespace wpi {
|
2016-11-01 22:33:12 -07:00
|
|
|
|
2024-01-05 07:35:59 -08:00
|
|
|
/**
|
|
|
|
|
* Robot state utility functions.
|
|
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
class RobotState {
|
|
|
|
|
public:
|
2019-08-24 22:28:39 -07:00
|
|
|
RobotState() = delete;
|
|
|
|
|
|
2024-01-05 07:35:59 -08:00
|
|
|
/**
|
|
|
|
|
* Returns true if the robot is disabled.
|
|
|
|
|
*
|
|
|
|
|
* @return True if the robot is disabled.
|
|
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
static bool IsDisabled();
|
2024-01-05 07:35:59 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the robot is enabled.
|
|
|
|
|
*
|
|
|
|
|
* @return True if the robot is enabled.
|
|
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
static bool IsEnabled();
|
2024-01-05 07:35:59 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the robot is E-stopped.
|
|
|
|
|
*
|
|
|
|
|
* @return True if the robot is E-stopped.
|
|
|
|
|
*/
|
2019-07-16 09:18:23 -05:00
|
|
|
static bool IsEStopped();
|
2024-01-05 07:35:59 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the robot is in teleop mode.
|
|
|
|
|
*
|
|
|
|
|
* @return True if the robot is in teleop mode.
|
|
|
|
|
*/
|
2021-08-11 23:04:43 -07:00
|
|
|
static bool IsTeleop();
|
2024-01-05 07:35:59 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the robot is in autonomous mode.
|
|
|
|
|
*
|
|
|
|
|
* @return True if the robot is in autonomous mode.
|
|
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
static bool IsAutonomous();
|
2024-01-05 07:35:59 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the robot is in test mode.
|
|
|
|
|
*
|
|
|
|
|
* @return True if the robot is in test mode.
|
|
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
static bool IsTest();
|
|
|
|
|
};
|
2016-11-01 22:33:12 -07:00
|
|
|
|
2025-11-07 20:00:05 -05:00
|
|
|
} // namespace wpi
|