From: moo Date: Fri, 1 May 2026 21:36:34 +0000 (-0500) Subject: move hood up and down to code X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=ef3be986f620a7249f77a123d56ecce877cba41e;p=FRC2026.git move hood up and down to code --- diff --git a/src/main/deploy/choreo/liberal.traj b/src/main/deploy/choreo/liberal.traj index c1e9830..7c07f15 100644 --- a/src/main/deploy/choreo/liberal.traj +++ b/src/main/deploy/choreo/liberal.traj @@ -238,9 +238,5 @@ {"t":7.79538, "x":3.00348, "y":7.57195, "heading":0.0, "vx":0.0, "vy":0.0, "omega":0.0, "ax":0.0, "ay":0.0, "alpha":0.0, "fx":[0.0,0.0,0.0,0.0], "fy":[0.0,0.0,0.0,0.0]}], "splits":[0,75] }, - "events":[ - {"name":"hoodDown", "from":{"target":0, "targetTimestamp":0.0, "offset":{"exp":"0 s", "val":0.0}}, "event":{"type":"named", "data":{"name":"hoodDown"}}}, - {"name":"hoodUp", "from":{"target":4, "targetTimestamp":3.70343, "offset":{"exp":"-0.2 s", "val":-0.2}}, "event":{"type":"named", "data":{"name":"hoodUp"}}}, - {"name":"hoodUp", "from":{"target":9, "targetTimestamp":7.79538, "offset":{"exp":"-0.2 s", "val":-0.2}}, "event":{"type":"named", "data":{"name":"hoodUp"}}}, - {"name":"hoodDown", "from":{"target":4, "targetTimestamp":3.70343, "offset":{"exp":"0.2 s", "val":0.2}}, "event":{"type":"named", "data":{"name":"hoodDown"}}}] + "events":[] } diff --git a/src/main/java/frc/robot/commands/auto_comm/ChoreoPathCommand.java b/src/main/java/frc/robot/commands/auto_comm/ChoreoPathCommand.java index dab46ce..44ca505 100644 --- a/src/main/java/frc/robot/commands/auto_comm/ChoreoPathCommand.java +++ b/src/main/java/frc/robot/commands/auto_comm/ChoreoPathCommand.java @@ -1,20 +1,15 @@ 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; @@ -53,17 +48,34 @@ public class ChoreoPathCommand { new InstantCommand(() -> { intake.extend(); intake.spinStart(); + hood.forceHoodDown(true); }), liberalSwipe.cmd())); liberalSwipe.done() .onTrue(Commands.sequence( + new InstantCommand(() -> { + hood.forceHoodDown(false); + }), new RunSpindexerWithStop(spindexer, turret, hood, intake).raceWith(new IntakeMovementCommand(intake)), + new InstantCommand(() -> { + intake.extend(); + intake.spinStart(); + hood.forceHoodDown(true); + }), shallowSwipe.cmd())); shallowSwipe.done() .onTrue(Commands.sequence( + new InstantCommand(() -> { + hood.forceHoodDown(false); + }), new RunSpindexerWithStop(spindexer, turret, hood, intake).raceWith(new IntakeMovementCommand(intake)), + new InstantCommand(() -> { + intake.extend(); + intake.spinStart(); + hood.forceHoodDown(true); + }), shallowSwipe.cmd())); return routine;