[hal,wpilib] Rename "Test" robot mode to "Utility" (#8782)

The "Utility" name better matches its intended generic use case and
avoids overloaded terminology with unit testing (e.g. the need to name
the opmode annotation `@TestOpMode`).

The driver station will also be updated to reflect this change.
This commit is contained in:
Peter Johnson
2026-04-20 20:29:25 -07:00
committed by GitHub
parent 14d14e4ebc
commit ab00aac960
111 changed files with 487 additions and 488 deletions

View File

@@ -91,23 +91,23 @@ public final class RobotState {
}
/**
* Gets a value indicating whether the Driver Station requires the robot to be running in Test
* Gets a value indicating whether the Driver Station requires the robot to be running in Utility
* mode.
*
* @return True if test mode should be enabled, false otherwise.
* @return True if utility mode should be enabled, false otherwise.
*/
public static boolean isTest() {
return DriverStationBackend.isTest();
public static boolean isUtility() {
return DriverStationBackend.isUtility();
}
/**
* Gets a value indicating whether the Driver Station requires the robot to be running in Test
* Gets a value indicating whether the Driver Station requires the robot to be running in Utility
* mode and enabled.
*
* @return True if test mode should be set and the robot should be enabled.
* @return True if utility mode should be set and the robot should be enabled.
*/
public static boolean isTestEnabled() {
return DriverStationBackend.isTestEnabled();
public static boolean isUtilityEnabled() {
return DriverStationBackend.isUtilityEnabled();
}
/**

View File

@@ -1167,30 +1167,30 @@ public final class DriverStationBackend {
}
/**
* Gets a value indicating whether the Driver Station requires the robot to be running in Test
* Gets a value indicating whether the Driver Station requires the robot to be running in Utility
* mode.
*
* @return True if test mode should be enabled, false otherwise.
* @return True if utility mode should be enabled, false otherwise.
*/
public static boolean isTest() {
public static boolean isUtility() {
m_cacheDataMutex.lock();
try {
return m_controlWord.isTest();
return m_controlWord.isUtility();
} finally {
m_cacheDataMutex.unlock();
}
}
/**
* Gets a value indicating whether the Driver Station requires the robot to be running in Test
* Gets a value indicating whether the Driver Station requires the robot to be running in Utility
* mode and enabled.
*
* @return True if test mode should be set and the robot should be enabled.
* @return True if utility mode should be set and the robot should be enabled.
*/
public static boolean isTestEnabled() {
public static boolean isUtilityEnabled() {
m_cacheDataMutex.lock();
try {
return m_controlWord.isTestEnabled();
return m_controlWord.isUtilityEnabled();
} finally {
m_cacheDataMutex.unlock();
}