Activity 5.7: Compare a Subsystem
🎯 Goal
By the end of this activity you will have:
- Selected a subsystem from a top team’s GitHub repository to study
- Analyzed its structure, patterns, and design decisions
- Compared it side-by-side with your team’s equivalent subsystem
- Documented your findings in a structured comparison table
Step 1: Choose a Top Team Repository
Pick one of these repositories to study:
| Team | Repository | Language |
|---|---|---|
| 254 The Cheesy Poofs | github.com/Team254 | Java |
| 6328 Mechanical Advantage | github.com/Mechanical-Advantage | Java |
| 1678 Citrus Circuits | github.com/frc1678 | Java |
Find their most recent season’s robot code repository and open it in your browser.
Team I’m studying: _______________ Repository URL: _______________
Step 2: Choose a Subsystem to Compare
Pick a subsystem that exists on both the top team’s robot and your team’s robot. Good choices:
| Your Team’s Subsystem | What to Search For in Their Repo |
|---|---|
| ”Intake”, “Roller”, “Feeder" | |
| "Shooter”, “Launcher”, “Flywheel" | |
| "Turret”, “Aimer”, “Hood" | |
| "Climber”, “Elevator”, “Endgame” |
Subsystem I’m comparing: _______________
Step 3: Read Their Subsystem
Open the top team’s subsystem file(s) and answer these questions. Take notes as you go.
-
How many files make up this subsystem? (Your team uses one file per subsystem. Do they use multiple?)
-
What motors and sensors does it use? (List the hardware — motor types, encoders, limit switches, etc.)
-
What are the public methods? (These define what the subsystem can do — list them all)
-
How do they handle constants? (Are constants in the file, in a separate Constants class, or somewhere else?)
-
Do they use an IO layer? (Look for interfaces like
IntakeIOorShooterIO) -
What happens in their
periodic()method? (What data do they read or log every cycle?)
When reading their subsystem, focus on these specific things:
- Constructor: What gets passed in? (IO objects? Constants? Other subsystems?)
- State variables: What private fields track the subsystem’s state?
- Control methods: How do they set motor speeds? Do they use PID, feedforward, or simple percent output?
- Logging: Do they log sensor values? How? (SmartDashboard, AdvantageKit Logger, etc.)
- Safety: Do they have any safety checks (soft limits, current limits, timeout logic)?
Step 4: Read Your Team’s Equivalent
Now open your team’s equivalent subsystem in your IDE. Answer the same questions:
- How many files? (Probably one — e.g.,
IntakeSubsystem.java) - What motors and sensors?
- What are the public methods?
- How are constants handled?
- Is there an IO layer? (Probably not — your team accesses hardware directly)
- What happens in
periodic()?
Step 5: Complete the Comparison
🔍 Comparison Exercise: Subsystem Architecture
Team to study: (fill in the team you chose — e.g., Team 6328 Mechanical Advantage)
Repository: (fill in the GitHub URL — e.g., https://github.com/Mechanical-Advantage/RobotCode2025)
File/folder to examine: (fill in the path — e.g., src/main/java/frc/robot/subsystems/intake/)
Guiding Questions
- How does their subsystem’s file organization differ from your team’s single-file approach? What are the advantages of each?
- What patterns do they use that your team doesn’t? (IO layers, state machines, command factories, etc.)
- How does their approach to logging and debugging compare to your team’s? Would their approach help you debug faster?
- If you could adopt one thing from their subsystem design, what would it be and why?
Document Your Findings
| Aspect | Their Team | Our Team | Why the Difference? |
|---|---|---|---|
| File count per subsystem | |||
| Hardware abstraction | |||
| Constants organization | |||
| Public method count | |||
| Logging approach | |||
| Control strategy (PID vs % output) | |||
| Safety checks | |||
| Code complexity |
Step 6: Reflect on What You Learned
Strong answers will include:
-
A specific structural difference — e.g., “They split their intake into 3 files (Intake.java, IntakeIO.java, IntakeIOTalonFX.java) while ours is one file. Their approach separates the logic from the hardware, making it testable.”
-
A specific adoptable pattern — e.g., “Their periodic() method logs every sensor value using AdvantageKit. We don’t log anything in periodic(), which makes it hard to debug issues after the fact.”
-
Something your team does well — e.g., “Our IntakeSubsystem is much easier to read because it’s all in one file. A new team member can understand the whole intake in 5 minutes. Their 3-file approach has a steeper learning curve.”
Bonus: Share Your Findings
Consider sharing your comparison with your team:
- Post your findings table in your team’s Slack/Discord
- Present it at a team meeting (5 minutes is enough)
- Add it to your team’s engineering notebook
Teaching others what you learned reinforces your own understanding and helps your whole team level up.
What’s Next?
You’ve now compared real code from a top team to your own. In Lesson 5.8: Debugging with Shuffleboard & AdvantageScope, you’ll learn how to use data visualization tools to debug your robot — logging values, reading graphs, and replaying matches to find issues faster than print statements ever could.