]> git.taranathan.com Git - FRC2026.git/commitdiff
whatevs
authormoo <moogoesmeow123@gmail.com>
Fri, 1 May 2026 14:15:25 +0000 (09:15 -0500)
committermoo <moogoesmeow123@gmail.com>
Fri, 1 May 2026 14:15:25 +0000 (09:15 -0500)
src/main/java/frc/robot/commands/auto_comm/ChoreoPathCommand.java

index 1f381e65a4402f133da25a2d10739bc93992988b..4c1679c25f7369f7d5c1f60be60259c902680746 100644 (file)
@@ -3,17 +3,59 @@ package frc.robot.commands.auto_comm;
 import org.littletonrobotics.junction.Logger;
 
 import choreo.auto.AutoFactory;
+import choreo.auto.AutoRoutine;
+import choreo.auto.AutoTrajectory;
+import edu.wpi.first.wpilibj2.command.Command;
+import edu.wpi.first.wpilibj2.command.Commands;
 import edu.wpi.first.wpilibj2.command.InstantCommand;
 import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
 import frc.robot.commands.DoNothing;
+import frc.robot.commands.gpm.IntakeCommand;
+import frc.robot.commands.gpm.IntakeMovementCommand;
+import frc.robot.commands.gpm.RunSpindexerWithStop;
+import frc.robot.subsystems.Intake.Intake;
 import frc.robot.subsystems.drivetrain.Drivetrain;
+import frc.robot.subsystems.hood.Hood;
+import frc.robot.subsystems.spindexer.Spindexer;
+import frc.robot.subsystems.turret.Turret;
 
-public class ChoreoPathCommand extends SequentialCommandGroup {
-  public ChoreoPathCommand(String pathName, boolean resetOdemetry, AutoFactory factory) {
-    var command = factory.trajectoryCmd(pathName);
+public class ChoreoPathCommand {
 
-    addCommands(
+  public static Command basicTrajectoryAuto(String pathName, boolean resetOdemetry, AutoFactory factory) {
+    Command command = factory.trajectoryCmd(pathName);
+
+    return Commands.sequence(
         resetOdemetry ? new InstantCommand(() -> factory.resetOdometry(pathName)) : new DoNothing(),
         command);
   }
+
+  public static AutoRoutine leftConservative(AutoFactory factory, Intake intake, Spindexer spindexer, Turret turret,
+      Hood hood) {
+    AutoRoutine routine = factory.newRoutine("leftConservative");
+
+    AutoTrajectory liberalSwipe = routine.trajectory("liberal");
+    AutoTrajectory shallowSwipe = routine.trajectory("shallowSwipe");
+
+    routine.active().onTrue(
+        Commands.sequence(
+            liberalSwipe.resetOdometry(),
+            new InstantCommand(() -> {
+              intake.extend();
+              intake.spinStart();
+            }),
+            liberalSwipe.cmd()));
+
+    liberalSwipe.done()
+        .onTrue(Commands.sequence(
+            new RunSpindexerWithStop(spindexer, turret, hood, intake).raceWith(new IntakeMovementCommand(intake)),
+            shallowSwipe.cmd()));
+
+    shallowSwipe.done()
+        .onTrue(Commands.sequence(
+            new RunSpindexerWithStop(spindexer, turret, hood, intake).raceWith(new IntakeMovementCommand(intake)),
+            shallowSwipe.cmd()));
+
+    return routine;
+
+  }
 }