Complex robot architectures require coordinating multiple mechanisms simultaneously: deploying an intake while an elevator ascends, timing shooter feed wheels to match flywheel surface speed, and logging telemetry for post-match analysis.
Stage 6 covers advanced command compositions, superstructure state machines, and competition data logging with AdvantageScope.
Orchestration Patterns
Section titled “Orchestration Patterns”Modern FRC programming replaces brittle multi-flag state logic with declarative command compositions:
[ Trigger: Score High ] --> Commands.sequence( ├── Commands.parallel(ArmMove, ElevatorAscend), ├── WaitUntil(FlywheelAtSpeed), ├── FeedWheelsRun.withTimeout(0.5s), └── Commands.parallel(ArmStow, ElevatorStow) )- Deterministic Execution: Every step starts only after the previous step meets its completion criteria.
- Built-in Cancellation: If the driver releases the button midway through the sequence, all active mechanisms cancel and return safely to their default commands.
- Safety Fallbacks: Every step is bounded by explicit timeouts.
Verified Sources & Standards
- WPILib Command Compositions Documentationdocs.wpilib.orgWPILib Standard
- AdvantageScope Documentation & Telemetry Replaydocs.advantagescope.orgCommunity Reference
Lessons
Advanced Command Compositions
Fluent composition patterns: sequence, parallel, race, deadline, conditional branching, and safety timeouts.
State Machines & Mechanism Interlocks
Superstructure coordination, preventing mechanism collisions, transit zones, and enum-driven state machines.
Telemetry Logging & AdvantageScope
WPILib DataLogManager, Epilogue annotation telemetry, AdvantageScope 3D visualization, post-match data analysis, and diagnostic troubleshooting.