Skip to content

Commit

Permalink
DISREGARD THIS THIS WAS FOR THE WRONG ROBOT IM SORRYYYY
Browse files Browse the repository at this point in the history
  • Loading branch information
nolandatall committed Nov 10, 2024
2 parents eba59da + 5e2b6f9 commit 272992b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public void autonomousInit() {
// FIXME: Add - if the match starts, then get the autonomous command (we already -
// are running the program through the following statements below

defaultAutoCommand.schedule();
robotContainer.getAutonomousCommand().schedule();

}

/** This function is called periodically during autonomous. */
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.FunctionalCommand;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.Constants.Mode;
import frc.robot.commands.DefaultAutoCommand;
import frc.robot.subsystems.RGBSubsystem;
import frc.robot.subsystems.flywheels.Flywheels;
import frc.robot.subsystems.flywheels.FlywheelsIOTalonFX;
Expand Down Expand Up @@ -518,5 +520,13 @@ public void containerMatchStarting() {
CommandScheduler.getInstance().schedule(/*FIXME - Vibrate the controller */ );
}

/**
* Use this to pass the autonomous command to the main {@link Robot} class.
*
* @return the command to run in autonomous
*/
public Command getAutonomousCommand() {
return new WaitCommand(1).andThen(new DefaultAutoCommand(rollers, swerve, flywheels, superstructure));
}
private void configureAutos() {}
}
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/commands/DefaultAutoCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import frc.robot.subsystems.rollers.Rollers;
import frc.robot.subsystems.rollers.Rollers.RollerState;
import frc.robot.subsystems.superstructure.Superstructure;
import frc.robot.subsystems.superstructure.Superstructure.SuperstructureState;
import frc.robot.subsystems.swerve.Drive;

public class DefaultAutoCommand extends SequentialCommandGroup {
Expand All @@ -22,6 +23,7 @@ public DefaultAutoCommand(
interrupted -> {
rollers.setTargetState(RollerState.IDLE);
flywheels.setVelocityTarget(Flywheels.VelocityTarget.SHOOT);
superstructure.setTargetState(SuperstructureState.SUBWOOF_SHOT);
},
() -> rollers.acceleratorDetected(),
rollers,
Expand Down

0 comments on commit 272992b

Please sign in to comment.