Skip to content
Merged

Cmp #131

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a542dec
auto, nt
arj2cool Apr 29, 2026
2cc5582
Merge branch 'vision-v2' of https://github.com/firebots-software/2026…
arj2cool Apr 29, 2026
29dbc79
longer
sidsenthilexe Apr 29, 2026
aee5061
longer again for leds
sidsenthilexe Apr 29, 2026
e4bda61
Merge branch 'cmp' of https://github.com/firebots-software/2026-Rebui…
sidsenthilexe Apr 29, 2026
4726f14
capper change
sidsenthilexe Apr 29, 2026
b8d35fd
build
sidsenthilexe Apr 30, 2026
f38af59
add time advance for areWeActive()
sidsenthilexe Apr 30, 2026
6fa7d43
swap
sidsenthilexe Apr 30, 2026
e6c8ce1
fix
sidsenthilexe Apr 30, 2026
6da6262
pranav fix
sidsenthilexe Apr 30, 2026
ae82ccf
transition fix
sidsenthilexe Apr 30, 2026
501a708
build
sidsenthilexe Apr 30, 2026
b2627b1
auto
arj2cool Apr 30, 2026
637f601
testing loghs
sidsenthilexe Apr 30, 2026
84dcf3b
ntpublish false
sidsenthilexe Apr 30, 2026
fcf2bd4
active first logging for ds display
sidsenthilexe Apr 30, 2026
afd311d
npe fixes
sidsenthilexe Apr 30, 2026
fcebe09
more npe protection
sidsenthilexe Apr 30, 2026
c5d56e7
optional checks
sidsenthilexe Apr 30, 2026
e34a257
lower brownout voltage
sidsenthilexe Apr 30, 2026
b4e1dab
log
sidsenthilexe Apr 30, 2026
a80ecfc
fix
sidsenthilexe Apr 30, 2026
1f9e573
nt off
sidsenthilexe Apr 30, 2026
6f0dccd
build
arj2cool May 1, 2026
359b4c0
reenable outtake and bind to b
sidsenthilexe May 1, 2026
d128fbd
Merge branch 'cmp' of https://github.com/firebots-software/2026-Rebui…
sidsenthilexe May 1, 2026
af9bd48
hub auto
arj2cool May 1, 2026
2d6afb5
headingfree false
sidsenthilexe May 1, 2026
509e029
shoots
arj2cool May 1, 2026
965d112
Merge branch 'cmp' of https://github.com/firebots-software/2026-Rebui…
arj2cool May 1, 2026
4b6b9da
headingfree off again
sidsenthilexe May 1, 2026
aad802e
disable ntpublish
sidsenthilexe May 1, 2026
43153ac
choreo 9-5
arj2cool May 1, 2026
4c80935
4
arj2cool May 1, 2026
3905157
p
arj2cool May 1, 2026
4d1ccae
shoot
arj2cool May 1, 2026
f2aa4b6
new sweeps
arj2cool May 1, 2026
92e221a
wait paths
arj2cool May 2, 2026
a9d87be
spotless
sidsenthilexe May 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 80 additions & 78 deletions src/main/deploy/choreo/HubLeft.traj

Large diffs are not rendered by default.

146 changes: 76 additions & 70 deletions src/main/deploy/choreo/HubRight.traj

Large diffs are not rendered by default.

388 changes: 192 additions & 196 deletions src/main/deploy/choreo/LeftSecondDip.traj

Large diffs are not rendered by default.

205 changes: 205 additions & 0 deletions src/main/deploy/choreo/LeftSecondDipShort.traj

Large diffs are not rendered by default.

75 changes: 42 additions & 33 deletions src/main/deploy/choreo/LeftShoot.traj

Large diffs are not rendered by default.

71 changes: 39 additions & 32 deletions src/main/deploy/choreo/LeftShootToBump.traj

Large diffs are not rendered by default.

398 changes: 206 additions & 192 deletions src/main/deploy/choreo/RightSecondDip.traj

Large diffs are not rendered by default.

207 changes: 207 additions & 0 deletions src/main/deploy/choreo/RightSecondDipShort.traj

Large diffs are not rendered by default.

76 changes: 41 additions & 35 deletions src/main/deploy/choreo/RightShoot.traj

Large diffs are not rendered by default.

73 changes: 41 additions & 32 deletions src/main/deploy/choreo/RightShootToBump.traj

Large diffs are not rendered by default.

277 changes: 265 additions & 12 deletions src/main/java/frc/robot/AutoRoutines.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import frc.robot.Constants.Swerve.Auto.ShootPos;
import frc.robot.commandGroups.IntakeToBumpDTP;
import frc.robot.commandGroups.ShootCommandGroups.ShootWithAim;
import frc.robot.commandGroups.ShootToBumpDTP;
import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.HopperSubsystem;
import frc.robot.subsystems.IntakeSubsystem;
Expand Down Expand Up @@ -110,7 +111,7 @@ public Command returnBasicShoot(BooleanSupplier isRedSide) {
swerveSubsystem,
isRedSide,
() -> false)
.withTimeout(4.0);
.withTimeout(3.5);

return shoot;
}
Expand All @@ -131,6 +132,22 @@ public Command returnBasicShootLessTime(BooleanSupplier isRedSide) {
return shoot;
}

public Command returnBasicShootMoreTime(BooleanSupplier isRedSide) {
Command shoot =
new ShootWithAim(
() -> 0.0,
() -> 0.0,
lebronShooterSubsystem,
intakeSubsystem,
hopperSubsystem,
swerveSubsystem,
isRedSide,
() -> false)
.withTimeout(4.2);

return shoot;
}

public Command driveForward(double time) {
return Commands.run(
() -> swerveSubsystem.applyFieldSpeeds(new ChassisSpeeds(3, 0, 0), new Feedforwards(4)),
Expand Down Expand Up @@ -180,6 +197,11 @@ public Command driveToBumpAfterIntake(BooleanSupplier isRedSide, BooleanSupplier
return new IntakeToBumpDTP(swerveSubsystem, isRedSide, isLeftSide);
}

public Command driveToBumpAfterShoot(BooleanSupplier isRedSide, BooleanSupplier isLeftSide) {
// return new IntakeToBumpDTP(swerveSubsystem, isRedSide).withTimeout(0.5);
return new ShootToBumpDTP(swerveSubsystem, isRedSide, isLeftSide);
}

// Middle
public AutoRoutine Nike() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");
Expand Down Expand Up @@ -306,6 +328,132 @@ public AutoRoutine PedriShortLeft() {
return routine;
}

public AutoRoutine PedriShortRightWait() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");

Command forward =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);
Command forward2 =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward2 =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);

AutoTrajectory intake1 = intake(routine, Constants.Swerve.Auto.Intake.RightIntakeSweepShort);
AutoTrajectory intakeToShoot1 = shoot(routine, Constants.Swerve.Auto.ShootPos.RightShoot);
AutoTrajectory shootToBump =
miscPaths(routine, Constants.Swerve.Auto.MiscPaths.RightShootToBump);
AutoTrajectory intake2 = intake(routine, Constants.Swerve.Auto.Intake.RightSecondDip);
AutoTrajectory intakeToShoot2 = shoot(routine, Constants.Swerve.Auto.ShootPos.RightShoot);

routine
.active()
.onTrue(
Commands.sequence(
Commands.waitSeconds(Constants.Swerve.Auto.WAIT_TIME_FOR_ALLIANCE),
forward,
intake1.resetOdometry(),
intake1.cmd()));

intake1
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> false),
backward,
intakeToShoot1.resetOdometry(),
intakeToShoot1.cmd()));

intakeToShoot1.done().onTrue(Commands.sequence(returnBasicShoot(redSide), shootToBump.cmd()));

shootToBump.done().onTrue(Commands.sequence(forward2, intake2.resetOdometry(), intake2.cmd()));

intake2
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> false),
backward2,
intakeToShoot2.resetOdometry(),
intakeToShoot2.cmd()));

intakeToShoot2.done().onTrue(returnBasicShoot(redSide));

return routine;
}

public AutoRoutine PedriShortLeftWait() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");

Command forward =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);
Command forward2 =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward2 =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);

AutoTrajectory intake1 = intake(routine, Constants.Swerve.Auto.Intake.LeftIntakeSweepShort);
AutoTrajectory intakeToShoot1 = shoot(routine, Constants.Swerve.Auto.ShootPos.LeftShoot);
AutoTrajectory shootToBump =
miscPaths(routine, Constants.Swerve.Auto.MiscPaths.LeftShootToBump);
AutoTrajectory intake2 = intake(routine, Constants.Swerve.Auto.Intake.LeftSecondDip);
AutoTrajectory intakeToShoot2 = shoot(routine, Constants.Swerve.Auto.ShootPos.LeftShoot);

routine
.active()
.onTrue(
Commands.sequence(
Commands.waitSeconds(Constants.Swerve.Auto.WAIT_TIME_FOR_ALLIANCE),
forward,
intake1.resetOdometry(),
intake1.cmd()));

intake1
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> true),
backward,
intakeToShoot1.resetOdometry(),
intakeToShoot1.cmd()));

intakeToShoot1.done().onTrue(Commands.sequence(returnBasicShoot(redSide), shootToBump.cmd()));

shootToBump.done().onTrue(Commands.sequence(forward2, intake2.resetOdometry(), intake2.cmd()));

intake2
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> true),
backward2,
intakeToShoot2.resetOdometry(),
intakeToShoot2.cmd()));

intakeToShoot2.done().onTrue(returnBasicShoot(redSide));

return routine;
}

public AutoRoutine HubSweepRight() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");

Expand Down Expand Up @@ -436,7 +584,7 @@ public AutoRoutine HubSweepLeft() {
public AutoRoutine DrakeOutpostShort() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");

AutoTrajectory outpostIntake = outpost(routine, Constants.Swerve.Auto.Outpost.OutpostStartPush);
AutoTrajectory outpostIntake = outpost(routine, Constants.Swerve.Auto.Outpost.OutpostStart);

routine.active().onTrue(Commands.sequence(outpostIntake.resetOdometry(), outpostIntake.cmd()));

Expand Down Expand Up @@ -498,16 +646,118 @@ public AutoRoutine DrakeDepotLong() {
return routine;
}

public AutoRoutine anthony() {
public AutoRoutine PedriShortRightHub() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");

AutoTrajectory depotIntake = miscPaths(routine, Constants.Swerve.Auto.MiscPaths.anthony);
Command forward =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);
Command forward2 =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward2 =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);

AutoTrajectory intake1 = intake(routine, Constants.Swerve.Auto.Intake.RightIntakeSweepShort);
AutoTrajectory intakeToShoot1 = shoot(routine, Constants.Swerve.Auto.ShootPos.RightShoot);
AutoTrajectory shootToBump =
miscPaths(routine, Constants.Swerve.Auto.MiscPaths.RightShootToBump);
AutoTrajectory intake2 = intake(routine, Constants.Swerve.Auto.Intake.HubRight);
AutoTrajectory intakeToShoot2 = shoot(routine, Constants.Swerve.Auto.ShootPos.RightShoot);

// routine.active().onTrue(Commands.sequence(depotIntake.resetOdometry(), depotIntake.cmd()));
// depotIntake.done().onTrue(Commands.sequence(returnBasicShoot(redSide).asProxy(),
// outpostIntake.cmd()));
// outpostIntake.done().onTrue(returnBasicShoot(redSide));
routine.active().onTrue(Commands.sequence(depotIntake.resetOdometry(), depotIntake.cmd()));
routine.active().onTrue(Commands.sequence(forward, intake1.resetOdometry(), intake1.cmd()));

intake1
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> false),
backward,
intakeToShoot1.resetOdometry(),
intakeToShoot1.cmd()));

intakeToShoot1
.done()
.onTrue(Commands.sequence(returnBasicShootMoreTime(redSide), shootToBump.cmd()));

shootToBump.done().onTrue(Commands.sequence(forward2, intake2.resetOdometry(), intake2.cmd()));

intake2
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> false),
backward2,
intakeToShoot2.resetOdometry(),
intakeToShoot2.cmd()));

intakeToShoot2.done().onTrue(returnBasicShootMoreTime(redSide));

return routine;
}

public AutoRoutine PedriShortLeftHub() {
AutoRoutine routine = autoFactory.newRoutine("CristianoRonaldo.chor");

Command forward =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);
Command forward2 =
redSide.getAsBoolean()
? driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS)
: driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_FORWARDS);
Command backward2 =
redSide.getAsBoolean()
? driveForward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS)
: driveBackward(Constants.Swerve.Auto.TIME_FOR_BUMP_BACKWARDS);

AutoTrajectory intake1 = intake(routine, Constants.Swerve.Auto.Intake.LeftIntakeSweepShort);
AutoTrajectory intakeToShoot1 = shoot(routine, Constants.Swerve.Auto.ShootPos.LeftShoot);
AutoTrajectory shootToBump =
miscPaths(routine, Constants.Swerve.Auto.MiscPaths.LeftShootToBump);
AutoTrajectory intake2 = intake(routine, Constants.Swerve.Auto.Intake.HubLeft);
AutoTrajectory intakeToShoot2 = shoot(routine, Constants.Swerve.Auto.ShootPos.LeftShoot);

routine.active().onTrue(Commands.sequence(forward, intake1.resetOdometry(), intake1.cmd()));

intake1
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> true),
backward,
intakeToShoot1.resetOdometry(),
intakeToShoot1.cmd()));

intakeToShoot1
.done()
.onTrue(Commands.sequence(returnBasicShootMoreTime(redSide), shootToBump.cmd()));

shootToBump.done().onTrue(Commands.sequence(forward2, intake2.resetOdometry(), intake2.cmd()));

intake2
.done()
.onTrue(
Commands.sequence(
driveToBumpAfterIntake(redSide, () -> true),
backward2,
intakeToShoot2.resetOdometry(),
intakeToShoot2.cmd()));

intakeToShoot2.done().onTrue(returnBasicShootMoreTime(redSide));

return routine;
}
Expand All @@ -516,16 +766,19 @@ public AutoRoutine anthony() {
public void addCommandstoAutoChooser() {
autoChooser.addRoutine("Right", () -> PedriShortRight());
autoChooser.addRoutine("Left", () -> PedriShortLeft());
autoChooser.addRoutine("Hub Sweep Left", () -> HubSweepLeft());
autoChooser.addRoutine("Hub Sweep Right", () -> HubSweepRight());
autoChooser.addRoutine("Right Wait", () -> PedriShortRightWait());
autoChooser.addRoutine("Left Wait", () -> PedriShortLeftWait());
// autoChooser.addRoutine("Right then Hub", () -> PedriShortRightHub());
// autoChooser.addRoutine("Left then Hub", () -> PedriShortLeftHub());
autoChooser.addRoutine("Hub Sweep Left Wait", () -> HubSweepLeft());
autoChooser.addRoutine("Hub Sweep Right Wait", () -> HubSweepRight());

autoChooser.addRoutine("Just Outpost", () -> DrakeOutpostShort());
autoChooser.addRoutine("Just Depot", () -> DrakeDepotShort());
autoChooser.addRoutine("Outpost to Depot", () -> DrakeOutpostLong());
autoChooser.addRoutine("Depot to Outpost", () -> DrakeDepotLong());

autoChooser.addRoutine("We are genuinely the worst robot on the field", () -> Nike());
autoChooser.addRoutine("bad word", () -> anthony());
}

public AutoChooser getAutoChooser() {
Expand Down
19 changes: 18 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static enum ChoreoPIDValues {
SERRANO(0.1d, 0d, 0d, 0.1d, 0d, 0d, 3.867d, 0d, 0d),
PROTO(0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d),
JAMES_HARDEN(0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d),
COBRA(3.467, 0, 0, 3.567, 0, 0, 9.0, 0, 0); // 3.75 m/s^2 max accel while turning max,
COBRA(3.467, 0, 0, 3.567, 0, 0, 2.5, 0, 0); // 3.75 m/s^2 max accel while turning max,
public final double kPX, kIX, kDX, kPY, kIY, kDY, kPR, kIR, kDR;

ChoreoPIDValues(
Expand Down Expand Up @@ -928,6 +928,23 @@ public static class Landmarks {
new Translation2d(5.624283313751221, 2.281606435775757),
new Rotation2d(1.57873264137917));

public static Pose2d RED_LEFT_SHOOT_TO_BUMP =
new Pose2d(
new Translation2d(12.9309492111206055, 2.3620588779449463),
new Rotation2d(1.5707963267948966));
public static Pose2d RED_RIGHT_SHOOT_TO_BUMP =
new Pose2d(
new Translation2d(12.951465606689453, 5.671574592590332),
new Rotation2d(-1.5707963267948966));
public static Pose2d BLUE_LEFT_SHOOT_TO_BUMP =
new Pose2d(
new Translation2d(3.60064959526062, 5.671574592590332),
new Rotation2d(-1.5649821399611368));
public static Pose2d BLUE_RIGHT_SHOOT_TO_BUMP =
new Pose2d(
new Translation2d(3.60064959526062, 2.3620588779449463),
new Rotation2d(1.57873264137917));

public static Pose2d BLUE_PASSING_L = new Pose2d(2.111, 6.003, new Rotation2d());
public static Pose2d BLUE_PASSING_R = new Pose2d(2.111, 2.007, new Rotation2d());

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ public void robotInit() {
RobotContainer.isRedAlliance();
DogLog.setOptions(
new DogLogOptions()
.withNtPublish(true)
.withNtPublish(false)
.withCaptureDs(true)
.withLogExtras(false)
.withNtTunables(false));
DogLog.log("Elastic/FieldPose", m_robotContainer.drivetrain.getCurrentState().Pose);
DogLog.log("Elastic/RedSide", RobotContainer.isRedAlliance());
RobotController.setBrownoutVoltage(6.0);
}

/**
Expand Down Expand Up @@ -78,6 +79,7 @@ private void elasticLogging() {
DogLog.log("Elastic/FieldPose", m_robotContainer.drivetrain.getCurrentState().Pose);
DogLog.log("Elastic/BatteryVoltage", RobotController.getBatteryVoltage());
DogLog.log("Elastic/AreWeActive", MiscUtils.areWeActive());
SmartDashboard.putString("Elastic/ActiveFirst", MiscUtils.activeFirst());
DogLog.log("Elastic/TimeUntilNextShift", MiscUtils.countdownTillNextShift(simulatedTime));
SmartDashboard.putNumber(
"Elastic/timeUntilNextShift", MiscUtils.countdownTillNextShift(simulatedTime));
Expand Down
Loading
Loading