[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

@@ -89,12 +89,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -63,11 +63,11 @@ public class Robot extends TimedRobot {
m_robotDrive.arcadeDrive(-m_controller.getLeftY(), -m_controller.getRightX());
}
/** This function is called once each time the robot enters test mode. */
/** This function is called once each time the robot enters utility mode. */
@Override
public void testInit() {}
public void utilityInit() {}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -91,12 +91,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -39,7 +39,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -98,12 +98,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -87,12 +87,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -82,12 +82,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -79,12 +79,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -82,14 +82,14 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
/** This function is called once when the robot is first started up. */
@Override

View File

@@ -64,11 +64,11 @@ public class Robot extends TimedRobot {
m_robotDrive.arcadeDrive(-m_controller.getRawAxis(2), -m_controller.getRawAxis(1));
}
/** This function is called once each time the robot enters test mode. */
/** This function is called once each time the robot enters utility mode. */
@Override
public void testInit() {}
public void utilityInit() {}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -89,12 +89,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -82,14 +82,14 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
/** This function is called once when the robot is first started up. */
@Override

View File

@@ -60,13 +60,13 @@ public class Robot extends TimedRobot {
public void teleopExit() {}
@Override
public void testInit() {
public void utilityInit() {
CommandScheduler.getInstance().cancelAll();
}
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
@Override
public void testExit() {}
public void utilityExit() {}
}

View File

@@ -28,7 +28,7 @@ public class EducationalRobot extends RobotBase {
run();
}
public void test() {
public void utility() {
run();
}
@@ -39,7 +39,7 @@ public class EducationalRobot extends RobotBase {
// Create an opmode per robot mode
RobotState.addOpMode(RobotMode.AUTONOMOUS, "Auto");
RobotState.addOpMode(RobotMode.TELEOPERATED, "Teleop");
RobotState.addOpMode(RobotMode.TEST, "Test");
RobotState.addOpMode(RobotMode.UTILITY, "Utility");
RobotState.publishOpModes();
final ControlWord word = new ControlWord();
@@ -73,9 +73,9 @@ public class EducationalRobot extends RobotBase {
Thread.currentThread().interrupt();
}
}
} else if (isTest()) {
test();
while (isTest() && isEnabled()) {
} else if (isUtility()) {
utility();
while (isUtility() && isEnabled()) {
try {
WPIUtilJNI.waitForObject(event);
} catch (InterruptedException e) {

View File

@@ -25,7 +25,7 @@ public class Robot extends RobotBase {
public void teleop() {}
public void test() {}
public void utility() {}
private volatile boolean m_exit;
@@ -34,7 +34,7 @@ public class Robot extends RobotBase {
// Create an opmode per robot mode
RobotState.addOpMode(RobotMode.AUTONOMOUS, "Auto");
RobotState.addOpMode(RobotMode.TELEOPERATED, "Teleop");
RobotState.addOpMode(RobotMode.TEST, "Test");
RobotState.addOpMode(RobotMode.UTILITY, "Utility");
RobotState.publishOpModes();
final ControlWord word = new ControlWord();
@@ -68,9 +68,9 @@ public class Robot extends RobotBase {
Thread.currentThread().interrupt();
}
}
} else if (isTest()) {
test();
while (isTest() && isEnabled()) {
} else if (isUtility()) {
utility();
while (isUtility() && isEnabled()) {
try {
WPIUtilJNI.waitForObject(event);
} catch (InterruptedException e) {

View File

@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -82,12 +82,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -28,7 +28,7 @@ public class EducationalRobot extends RobotBase {
run();
}
public void test() {
public void utility() {
run();
}
@@ -39,7 +39,7 @@ public class EducationalRobot extends RobotBase {
// Create an opmode per robot mode
RobotState.addOpMode(RobotMode.AUTONOMOUS, "Auto");
RobotState.addOpMode(RobotMode.TELEOPERATED, "Teleop");
RobotState.addOpMode(RobotMode.TEST, "Test");
RobotState.addOpMode(RobotMode.UTILITY, "Utility");
RobotState.publishOpModes();
final ControlWord word = new ControlWord();
@@ -73,9 +73,9 @@ public class EducationalRobot extends RobotBase {
Thread.currentThread().interrupt();
}
}
} else if (isTest()) {
test();
while (isTest() && isEnabled()) {
} else if (isUtility()) {
utility();
while (isUtility() && isEnabled()) {
try {
WPIUtilJNI.waitForObject(event);
} catch (InterruptedException e) {

View File

@@ -33,7 +33,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -90,11 +90,11 @@ public class Robot extends TimedRobot {
@Override
public void disabledPeriodic() {}
/** This function is called once when test mode is enabled. */
/** This function is called once when utility mode is enabled. */
@Override
public void testInit() {}
public void utilityInit() {}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -31,7 +31,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -86,13 +86,13 @@ public class Robot extends TimedRobot {
@Override
public void disabledPeriodic() {}
/** This function is called once when test mode is enabled. */
/** This function is called once when utility mode is enabled. */
@Override
public void testInit() {}
public void utilityInit() {}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
/** This function is called once when the robot is first started up. */
@Override

View File

@@ -40,10 +40,10 @@ public class Robot extends TimedRobot {
public void disabledPeriodic() {}
@Override
public void testInit() {}
public void utilityInit() {}
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
@Override
public void simulationInit() {}

View File

@@ -40,7 +40,7 @@ public class Robot extends TimesliceRobot {
/**
* This function is called every robot packet, no matter the mode. Use this for items like
* diagnostics that you want ran during disabled, autonomous, teleoperated and test.
* diagnostics that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -95,11 +95,11 @@ public class Robot extends TimesliceRobot {
@Override
public void disabledPeriodic() {}
/** This function is called once when test mode is enabled. */
/** This function is called once when utility mode is enabled. */
@Override
public void testInit() {}
public void utilityInit() {}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -50,8 +50,8 @@ public class Robot extends TimesliceRobot {
public void disabledPeriodic() {}
@Override
public void testInit() {}
public void utilityInit() {}
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -82,12 +82,12 @@ public class Robot extends TimedRobot {
public void teleopPeriodic() {}
@Override
public void testInit() {
// Cancels all running commands at the start of test mode.
public void utilityInit() {
// Cancels all running commands at the start of utility mode.
CommandScheduler.getInstance().cancelAll();
}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}

View File

@@ -28,7 +28,7 @@ public class EducationalRobot extends RobotBase {
run();
}
public void test() {
public void utility() {
run();
}
@@ -39,7 +39,7 @@ public class EducationalRobot extends RobotBase {
// Create an opmode per robot mode
RobotState.addOpMode(RobotMode.AUTONOMOUS, "Auto");
RobotState.addOpMode(RobotMode.TELEOPERATED, "Teleop");
RobotState.addOpMode(RobotMode.TEST, "Test");
RobotState.addOpMode(RobotMode.UTILITY, "Utility");
RobotState.publishOpModes();
final ControlWord word = new ControlWord();
@@ -73,9 +73,9 @@ public class EducationalRobot extends RobotBase {
Thread.currentThread().interrupt();
}
}
} else if (isTest()) {
test();
while (isTest() && isEnabled()) {
} else if (isUtility()) {
utility();
while (isUtility() && isEnabled()) {
try {
WPIUtilJNI.waitForObject(event);
} catch (InterruptedException e) {

View File

@@ -33,7 +33,7 @@ public class Robot extends TimedRobot {
/**
* This function is called every 20 ms, no matter the mode. Use this for items like diagnostics
* that you want ran during disabled, autonomous, teleoperated and test.
* that you want ran during disabled, autonomous, teleoperated and utility.
*
* <p>This runs after the mode specific periodic functions, but before LiveWindow and
* SmartDashboard integrated updating.
@@ -90,11 +90,11 @@ public class Robot extends TimedRobot {
@Override
public void disabledPeriodic() {}
/** This function is called once when test mode is enabled. */
/** This function is called once when utility mode is enabled. */
@Override
public void testInit() {}
public void utilityInit() {}
/** This function is called periodically during test mode. */
/** This function is called periodically during utility mode. */
@Override
public void testPeriodic() {}
public void utilityPeriodic() {}
}