mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Add RobotState#IsEStopped and DriverStation#IsEStopped (#952)
This commit is contained in:
@@ -625,6 +625,18 @@ public class DriverStation {
|
||||
return !isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value indicating whether the Robot is e-stopped.
|
||||
*
|
||||
* @return True if the robot is e-stopped, false otherwise.
|
||||
*/
|
||||
public boolean isEStopped() {
|
||||
synchronized (m_controlWordMutex) {
|
||||
updateControlWord(false);
|
||||
return m_controlWordCache.getEStop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value indicating whether the Driver Station requires the robot to be running in
|
||||
* autonomous mode.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -17,6 +17,10 @@ public final class RobotState {
|
||||
return DriverStation.getInstance().isEnabled();
|
||||
}
|
||||
|
||||
public static boolean isEStopped() {
|
||||
return DriverStation.getInstance().isEStopped();
|
||||
}
|
||||
|
||||
public static boolean isOperatorControl() {
|
||||
return DriverStation.getInstance().isOperatorControl();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user