Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit f6ba687

Browse files
committed
Update subsystem priorities for new StateMachine pattern
1 parent a2b82f1 commit f6ba687

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/main/java/frc/robot/util/scheduling/SubsystemPriority.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
package frc.robot.util.scheduling;
22

33
public enum SubsystemPriority {
4-
// Vision must run before **everything** to ensure that the cached data is fresh
5-
VISION(50),
4+
// 20-29 is for sensor subsystems
65

7-
NOTE_TRACKING(41),
8-
AUTOS(40),
6+
// IMU runs before vision so that it has fresh data to pass to MegaTag2
7+
IMU(22),
8+
// Vision runs before localization so that it has fresh vision data for pose estimator
9+
VISION(21),
10+
// Localization runs before arm and shooter so that they have fresh speaker distance values
11+
LOCALIZATION(20),
12+
FMS(20),
913

10-
ROBOT_MANAGER(30),
14+
// 10-19 is for actuator subsystems
1115

12-
SNAPS(20),
13-
14-
SWERVE(10),
15-
IMU(10),
16+
ARM(10),
1617
SHOOTER(10),
17-
LOCALIZATION(10),
18-
INTAKE(10),
1918
QUEUER(10),
20-
ARM(10),
19+
INTAKE(10),
20+
21+
// 0-9 is for manager subsystems
2122

22-
FMS(0),
23-
RUMBLE_CONTROLLER(0);
23+
// Robot manager runs last so that all sensor data is fresh before processing state transitions
24+
ROBOT_MANAGER(0),
25+
AUTOS(0);
2426

2527
final int value;
2628

0 commit comments

Comments
 (0)