Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/spectrum3847/2026-Spectrum/llms.txt

Use this file to discover all available pages before exploring further.

Fuel game pieces travel through four coordinated subsystems before reaching the launcher: the FuelIntake roller pulls pieces off the ground, the IntakeExtension arm positions the intake at the correct height, the IndexerBed conveys pieces across the robot chassis, and the IndexerTower lifts them into the launcher. Each subsystem is an independent Mechanism wrapping a TalonFX and follows the same States-based command pattern.

Subsystem roles

The FuelIntake subsystem runs one primary TalonFX (CAN ID 5, RIO bus) with a follower motor. It operates in Torque-FOC current control for intake and eject commands.
State methodBehavior
intakeFuel()Full torque intake at fuelIntakeTorqueCurrent (130 A)
slowIntakeFuel()Reduced torque at fuelSlowIntakeTorqueCurrent (45 A)
agitateFuel()Repeating sequence: intake torque for a cycle, then 0.5 s pause
ejectCommand()Reverse torque at −50 A to clear jams
neutral() / stop()Zero voltage / stop motor
FuelIntakeStates.java
public static void intakeFuel() {
    scheduleIfNotRunning(
            intake.runTorqueFOC(config::getFuelIntakeTorqueCurrent)
                    .withName("Intake.intakeFuel"));
}

public static void agitateFuel() {
    scheduleIfNotRunning(
            Commands.repeatingSequence(
                            intake.runTorqueFOC(config::getFuelAgitationTorqueCurrent),
                            Commands.waitSeconds(0.5))
                    .withName("Intake.agitate"));
}
The IndexerBed subsystem (CAN ID 8, CANIVORE) moves fuel across the robot bed from the intake roller toward the tower. It uses velocity Torque-FOC control and includes a follower motor aligned in opposition.
State methodBehavior
indexMax()Full feed velocity (IndexerBedFeedRPM, tunable)
slowIndex()Reduced feed at indexerSlowVelocityRPM (1000 RPM)
unjam() / unjamCommand()Reverse at indexerUnjamRPM (−2000 RPM)
neutral()Zero voltage
IndexerBedStates.java
public static void indexMax() {
    scheduleIfNotRunning(
            indexerBed
                    .runVelocityTcFocRPM(config.getIndexerBedFeedRPM())
                    .withName("IndexerBed.feedMax"));
}

public static Command unjamCommand() {
    return indexerBed.runVelocityTcFocRPM(config::getIndexerUnjamRPM);
}
The IndexerTower subsystem lifts fuel vertically into the launcher. It mirrors the IndexerBed command structure and adds quickReverseThenIndex, which momentarily reverses (1 s) before resuming feed — useful for clearing a brief jam without triggering a full UNJAM state.
IndexerTowerStates.java
public static void quickReverseThenIndex() {
    scheduleIfNotRunning(
            Commands.sequence(
                    indexerTower.runVelocityTcFocRPM(config::getIndexerUnjamRPM).withTimeout(1),
                    indexerTower.runVelocityTcFocRPM(config.getIndexerTowerFeedRPM())));
}

hasFuel() sensor trigger

IndexerBed exposes a hasFuel() trigger that reads a beam-break or proximity sensor to detect whether a fuel game piece is present in the bed. Other subsystems and RobotStates use this trigger to gate commands — for example, to stop the intake roller once the indexer is loaded, or to allow the launcher to fire.
RobotStates.java (conceptual binding)
// Only advance the tower once the bed detects fuel
IndexerBedStates.hasFuel().onTrue(IndexerTowerStates.slowIndexCommand());
hasFuel() is documented in the season guide as indexerBed.hasFuel(). Consult IndexerBed.java for the sensor wiring and debounce configuration.

INTAKE_FUEL coordination via Coordinator

When the Coordinator applies the INTAKE_FUEL state it calls into each States class simultaneously:
SubsystemState applied
FuelIntakeintakeFuel()
IntakeExtensionfullExtend()
IndexerBedindexMax() or slowIndex()
IndexerTowerneutral() (waiting for bed to fill)
LauncheridlePrep() (spinning up to idle RPM)
This means no single subsystem’s States file is responsible for orchestrating the full intake sequence — the Coordinator drives them all from the top-level State enum.

Default commands and scheduleIfNotRunning

Every States class uses scheduleIfNotRunning to avoid interrupting the currently running command with an identical one. This pattern prevents command churn when Coordinator repeatedly applies the same state on each loop iteration.
FuelIntakeStates.java
public static void scheduleIfNotRunning(Command command) {
    CommandScheduler commandScheduler = CommandScheduler.getInstance();
    Command current = commandScheduler.requiring(intake);
    if (current != command) {
        commandScheduler.schedule(command);
    }
}

FuelIntake source

Motor config, follower setup, and simulation roller config.

IndexerBed source

Bed conveyor motor config and velocity PID gains.

IndexerTower source

Tower lift motor config and quickReverseThenIndex logic.

Build docs developers (and LLMs) love