Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
00290ce
Tune l4
SCool62 Apr 8, 2025
051b2aa
reenable auto release
LewisSeiden Apr 8, 2025
28120ed
L1 autoalign (#106)
SCool62 Apr 8, 2025
fbe08e5
L1 tuning at loom
SCool62 Apr 8, 2025
830acc9
Algae autos fr (#113)
spellingcat Apr 9, 2025
593d27e
steepen barge shot angle again
LewisSeiden Apr 9, 2025
3a83f51
reintroduce toss, use vel threshold
LewisSeiden Apr 9, 2025
261c5bb
add algae intaking to graph
LewisSeiden Apr 9, 2025
00ba4e6
tune accel/vel constraints, extend elevator earlier
spellingcat Apr 9, 2025
fe7d418
increase accel
spellingcat Apr 9, 2025
d43e0f5
turn off current limits in auto
spellingcat Apr 9, 2025
f374f1e
adjust hp shoulder pos
spellingcat Apr 9, 2025
3d420de
speed up ground intake
LewisSeiden Apr 10, 2025
4a881b3
slow down barge shot
LewisSeiden Apr 10, 2025
2172d62
adjust shoulder pose for ground algae
LewisSeiden Apr 10, 2025
cfde337
more barge tuning
LewisSeiden Apr 10, 2025
2e14b80
add algae ground to graph
LewisSeiden Apr 10, 2025
ac01ffd
adjust coral hold pose, add more edges for l4 to algae intake cancelling
LewisSeiden Apr 10, 2025
7439d01
adjust graph
LewisSeiden Apr 10, 2025
68e5791
make net autoalign use angle
LewisSeiden Apr 10, 2025
4620e9c
reduce manipulator stator limit
LewisSeiden Apr 10, 2025
db7a81b
increase autoain kd
LewisSeiden Apr 10, 2025
58cb824
adjust ground algae
LewisSeiden Apr 10, 2025
2b99dc1
tune coral hold pos and pid
LewisSeiden Apr 10, 2025
edb46fb
jog coral back during scoring
LewisSeiden Apr 10, 2025
4e00c50
make auto algae logic actually make sense :sob:
spellingcat Apr 10, 2025
bbf418f
add barge intermediate + change angle
spellingcat Apr 10, 2025
3c8fb1d
algae auto stuff that doesn't really work yet
spellingcat Apr 10, 2025
56c6b52
more algae auto tuning, BARGE SHOT IS FUCKED
spellingcat Apr 10, 2025
0d83f63
yet more barge tuning, auto was overcooked
spellingcat Apr 10, 2025
63cca92
Add rezero button binding
SCool62 Apr 10, 2025
4231eb7
zero shoulder correctly
spellingcat Apr 10, 2025
bd06530
Reduce jog distance on l4
SCool62 Apr 11, 2025
fac858f
Spotless
SCool62 Apr 11, 2025
d251013
Merge branch 'pre-champs' of https://github.com/HighlanderRobotics/Re…
SCool62 Apr 11, 2025
3ec3f27
Add a dumb anti-coral jam binding
SCool62 Apr 11, 2025
1660228
Tune ground algae intake
SCool62 Apr 11, 2025
c3bd8fc
move algae intake into its own method, add preliminary rest of path
spellingcat Apr 12, 2025
94daef1
cancoder retuning
spellingcat Apr 12, 2025
fee140e
tuning again
spellingcat Apr 12, 2025
fe4280e
redo wrist zero at start of auto
spellingcat Apr 12, 2025
7cd4d9a
yayyy
spellingcat Apr 12, 2025
9e8ec06
works except for last intake
spellingcat Apr 12, 2025
25ac563
change idle shoulder position
spellingcat Apr 12, 2025
96cab99
copy over stuff from other branch
spellingcat Apr 12, 2025
a25d8eb
made path less aggressive
spellingcat Apr 12, 2025
bbeece3
welp i tried
spellingcat Apr 12, 2025
361f235
pov plane :plane:
spellingcat Apr 16, 2025
3b60380
swap beambreaks
LewisSeiden Apr 16, 2025
04ad2df
increase auto score debounce time
LewisSeiden Apr 17, 2025
f9aea1c
adjust jog pose for l2/3 extension
LewisSeiden Apr 17, 2025
e3aca34
adjust jog pose more
LewisSeiden Apr 17, 2025
46b84c7
adjust coral pose zeroing after ground logic
LewisSeiden Apr 17, 2025
363831b
adjust l1 jog pose
LewisSeiden Apr 17, 2025
4759d8c
adjust l4 wrist
LewisSeiden Apr 17, 2025
fe4b131
add alert for vision data coming from ✨the future✨
LewisSeiden Apr 17, 2025
271137d
log statuscodes
LewisSeiden Apr 17, 2025
470e010
Update at 'Thu Apr 17 14:03:11 PDT 2025'
LewisSeiden Apr 17, 2025
ad3db47
add anti algae jam
LewisSeiden Apr 17, 2025
673f76c
increase anti algae jam height
LewisSeiden Apr 17, 2025
5ca1531
log current targets
LewisSeiden Apr 18, 2025
6776d3f
fix algae extension pathing positions
LewisSeiden Apr 18, 2025
2c82144
add explicit l3 state
LewisSeiden Apr 18, 2025
bc8add0
adjust wrist zeroing
LewisSeiden Apr 18, 2025
4d81bad
reverse wrist zeroing direction
LewisSeiden Apr 18, 2025
ba071a9
Update at 'Fri Apr 18 09:11:14 PDT 2025'
LewisSeiden Apr 18, 2025
a16bf35
Update at 'Fri Apr 18 09:16:25 PDT 2025'
LewisSeiden Apr 18, 2025
f4734f3
Update at 'Fri Apr 18 09:20:29 PDT 2025'
LewisSeiden Apr 18, 2025
77b6fb4
Revert "Update at 'Fri Apr 18 09:20:29 PDT 2025'"
LewisSeiden Apr 18, 2025
555f467
Revert "Update at 'Fri Apr 18 09:16:25 PDT 2025'"
LewisSeiden Apr 18, 2025
506f44e
Revert "Update at 'Fri Apr 18 09:11:14 PDT 2025'"
LewisSeiden Apr 18, 2025
458cd5c
Revert "reverse wrist zeroing direction"
LewisSeiden Apr 18, 2025
038fc46
make intake algae high use untucked path
LewisSeiden Apr 18, 2025
2eb3e48
ground algae tuning
LewisSeiden Apr 18, 2025
382c795
try reducing barge angle
LewisSeiden Apr 18, 2025
a3b5827
slight delay after intaking + revert barge change
LewisSeiden Apr 18, 2025
75b1267
sike
LewisSeiden Apr 18, 2025
0afb156
fmt
LewisSeiden Apr 19, 2025
51a18b6
add delay to center auto
LewisSeiden Apr 19, 2025
3346e2b
Update at 'Sat Apr 19 06:28:41 PDT 2025'
LewisSeiden Apr 19, 2025
2bff98c
adjust stack height
LewisSeiden Apr 19, 2025
9362426
wait less in algae auto
LewisSeiden Apr 19, 2025
e61608f
Merge branch 'main' into event-cmp
spellingcat Aug 30, 2025
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
155 changes: 155 additions & 0 deletions src/main/deploy/choreo/AtoB better.traj

Large diffs are not rendered by default.

160 changes: 77 additions & 83 deletions src/main/deploy/choreo/AtoB.traj

Large diffs are not rendered by default.

217 changes: 103 additions & 114 deletions src/main/deploy/choreo/BtoB.traj

Large diffs are not rendered by default.

117 changes: 111 additions & 6 deletions src/main/java/frc/robot/Autos.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ public Command CMtoGH() { // algae path
routine
// run first path
.active()
.whileTrue(Commands.sequence(steps.get("CMtoG").resetOdometry(), steps.get("CMtoG").cmd()));
.whileTrue(
Commands.sequence(
steps.get("CMtoG").resetOdometry(),
Commands.waitSeconds(1.5),
steps.get("CMtoG").cmd()));

routine
.observe(steps.get("CMtoG").done()) // TODO change to time based
Expand All @@ -360,6 +364,68 @@ public Command CMtoGH() { // algae path
Commands.sequence(
intakeAlgaeInAuto(() -> steps.get("NItoIJ").getFinalPose()),
swerve.driveTeleop(() -> new ChassisSpeeds(-0.5, 0, 0)).withTimeout(0.2)));

// routine
// .observe(
// steps
// .get("IJtoNI")
// .atTime(steps.get("IJtoNI").getRawTrajectory().getTotalTime() - 0.2)) // TODO
// tune
// .onTrue(Commands.sequence(scoreAlgaeInAuto(), steps.get("NItoEF").cmd()));
// routine
// .observe(steps.get("NItoEF").done())
// .onTrue(Commands.sequence(intakeAlgaeInAuto(() -> steps.get("NItoEF").getFinalPose())));

// ---------------------------
// Commands.sequence(
// // AutoAim.translateToXCoord(
// // swerve,
// // () ->
// // DriverStation.getAlliance().get() == Alliance.Blue
// // ? AutoAim.BLUE_NET_X
// // : AutoAim.RED_NET_X,
// // () -> 0,
// // () ->
// // DriverStation.getAlliance().get() == Alliance.Blue
// // ? Rotation2d.k180deg
// // : Rotation2d.kZero.plus(Rotation2d.fromDegrees(20.0)))
// AutoAim.translateToPose(swerve,
// () -> new Pose2d(DriverStation.getAlliance().get() == Alliance.Blue
// ? AutoAim.BLUE_NET_X
// : AutoAim.RED_NET_X,
// steps.get("GhtoNI").))
// .until(
// () ->
// (MathUtil.isNear(
// DriverStation.getAlliance().get() == Alliance.Blue
// ? AutoAim.BLUE_NET_X
// : AutoAim.RED_NET_X,
// swerve.getPose().getX(),
// Units.inchesToMeters(5))
// && MathUtil.isNear(
// DriverStation.getAlliance().get() == Alliance.Blue
// ? Rotation2d.k180deg
// .plus(Rotation2d.fromDegrees(20.0))
// .getDegrees()
// : Rotation2d.kZero
// .plus(Rotation2d.fromDegrees(20.0))
// .getDegrees(),
// swerve.getPose().getRotation().getDegrees(),
// 5.0))),
// scoreAlgaeInAuto())
// )

// routine.observe(steps.get("NItoIJ").done()).; //TODO cancel into autoalign

// for (int i = 0; i < stops.length - 2; i++) {
// String startPos = stops[i];
// String endPos = stops[i + 1];
// String nextPos = stops[i + 2];
// runAlgaePath(routine, startPos, endPos, nextPos, steps);
// }
// routine
// .observe(steps.get("NItoEF").done())
// .onTrue(intakeAlgaeInAuto(() -> steps.get("NItoEF").getFinalPose()));
return routine.cmd();
}

Expand All @@ -370,6 +436,9 @@ public Command LOtoA() { // 2910
// lo a b4 b2 dealgae
steps.put("LOtoA", routine.trajectory("LOtoA"));
steps.put("AtoB", routine.trajectory("AtoB"));
steps.put("BtoB", routine.trajectory("BtoB"));

if (Robot.isSimulation()) manipulator.setSecondBeambreak(true); // gah
routine
// run first path
.active()
Expand All @@ -381,12 +450,41 @@ public Command LOtoA() { // 2910
.onTrue(
Commands.sequence(
scoreCoralInAuto(() -> steps.get("LOtoA").getFinalPose().get()),
Commands.runOnce(() -> autoGroundCoralIntake = true),
swerve
.driveTeleop(() -> new ChassisSpeeds(-0.3, 0, 0))
AutoAim.translateToPose(swerve, () -> steps.get("AtoB").getInitialPose().get())
.until(
() -> elevator.isNearExtension(ElevatorSubsystem.GROUND_EXTENSION_METERS)),
() ->
elevator.isNearExtension(ElevatorSubsystem.GROUND_EXTENSION_METERS)
&& AutoAim.isInTolerance(
swerve.getPose(), steps.get("AtoB").getInitialPose().get())),
Commands.runOnce(() -> Robot.setCurrentTarget(ReefTarget.L2)),
steps.get("AtoB").cmd()));
routine
.observe(
steps
.get("AtoB")
.active()
.and(() -> manipulator.getSecondBeambreak() || manipulator.getFirstBeambreak()))
.onTrue(
Commands.runOnce(
() -> {
autoGroundCoralIntake = false;
Robot.setCurrentTarget(ReefTarget.L4);
}));

routine
.observe(
steps.get("AtoB").atTime(steps.get("AtoB").getRawTrajectory().getTotalTime() - 0.3))
.onTrue(
Commands.sequence(
scoreCoralInAuto(() -> steps.get("AtoB").getFinalPose().get()),
AutoAim.translateToPose(swerve, () -> steps.get("BtoB").getInitialPose().get())
.until(
() ->
elevator.isNearExtension(ElevatorSubsystem.GROUND_EXTENSION_METERS)
&& AutoAim.isInTolerance(
swerve.getPose(), steps.get("BtoB").getInitialPose().get())),
Commands.runOnce(() -> autoGroundCoralIntake = true),
steps.get("BtoB").cmd()));

// routine
// .observe(() -> !manipulator.getFirstBeambreak() && !manipulator.getSecondBeambreak())
Expand Down Expand Up @@ -443,7 +541,7 @@ public Command scoreCoralInAuto(Supplier<Pose2d> trajEndPose) {
0.0,
swerve.getVelocityRobotRelative().omegaRadiansPerSecond,
3.0))
.debounce(0.06)),
.debounce(0.06 * 2)),
Commands.print("Scoring!"),
Commands.runOnce(
() -> {
Expand Down Expand Up @@ -517,6 +615,13 @@ public void bindCoralElevatorExtension(AutoRoutine routine, double toleranceMete
.whileFalse(Commands.run(() -> autoPreScore = false));
}

public void bindGroundCoralElevatorExtension(
AutoRoutine routine, double toleranceMeters, Trigger trigger) {
routine.observe(trigger).debounce(3).onTrue(Commands.run(() -> autoGroundCoralIntake = true));
}

// ([[[){ ([[[){ ([[[){ ([[[){ ([[[){ ([[[){ ([[[){ ([[[){ ([[[){ ([[[){

public void bindAlgaeElevatorExtension(AutoRoutine routine, double toleranceMeters) {
routine
.observe(
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ public static enum AlgaeScoreTarget {
PROCESSOR
}

private static ReefTarget currentTarget = ReefTarget.L4;
private static AlgaeIntakeTarget algaeIntakeTarget = AlgaeIntakeTarget.STACK;
private static AlgaeScoreTarget algaeScoreTarget = AlgaeScoreTarget.NET;
@AutoLogOutput private static ReefTarget currentTarget = ReefTarget.L4;
@AutoLogOutput private static AlgaeIntakeTarget algaeIntakeTarget = AlgaeIntakeTarget.STACK;
@AutoLogOutput private static AlgaeScoreTarget algaeScoreTarget = AlgaeScoreTarget.NET;
private boolean leftHandedTarget = false;

@AutoLogOutput private boolean killVisionIK = true;
Expand Down Expand Up @@ -327,8 +327,8 @@ public static enum AlgaeScoreTarget {
new SimpleMotorFeedforward(0.0, 0.7),
new ProfiledPIDController(
0.5, 0.0, 0.0, new TrapezoidProfile.Constraints(15, 1))),
new BeambreakIOReal(1, true),
new BeambreakIOReal(0, true));
new BeambreakIOReal(0, true),
new BeambreakIOReal(1, true));

private final ShoulderSubsystem shoulder =
new ShoulderSubsystem(
Expand Down Expand Up @@ -492,6 +492,7 @@ public static enum AlgaeScoreTarget {
.debounce(0.5)
.or(operator.leftStick().and(operator.rightTrigger()).debounce(0.5)),
driver.a(),
driver.b(),
driver.start(),
operator.rightBumper(),
operator.leftBumper(),
Expand Down Expand Up @@ -1007,7 +1008,7 @@ public Robot() {
> Math.abs(swerve.getPose().getX() - AutoAim.RED_NET_X)
? Rotation2d.kZero
: Rotation2d.k180deg)
.plus(Rotation2d.fromDegrees(30.0))),
.plus(Rotation2d.fromDegrees(20.0))),
Commands.waitUntil(
() -> {
final var diff =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ExtensionKinematics {
Rotation2d.fromRadians(2.427));
public static final Pose2d L3_POSE = solveFK(L3_EXTENSION);
public static final Pose2d L4_POSE =
new Pose2d(new Translation2d(0.20, 2.03), Rotation2d.fromDegrees(110.0));
new Pose2d(new Translation2d(0.20, 2.03), Rotation2d.fromDegrees(115.0));

public static final ExtensionState L4_EXTENSION = solveIK(L4_POSE);

Expand Down
17 changes: 15 additions & 2 deletions src/main/java/frc/robot/subsystems/ExtensionPathing.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.google.common.graph.MutableGraph;
import edu.wpi.first.math.Pair;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.util.Units;
import frc.robot.subsystems.ExtensionKinematics.ExtensionState;
import frc.robot.subsystems.elevator.ElevatorSubsystem;
import frc.robot.subsystems.shoulder.ShoulderSubsystem;
Expand Down Expand Up @@ -56,6 +57,9 @@ public class ExtensionPathing {
graph.addNode(l3Tucked);
graph.putEdge(tucked, l3Tucked);
graph.putEdge(l3Tucked, l2Tucked);
final var l3 = ExtensionKinematics.L3_EXTENSION;
graph.addNode(l3);
graph.putEdge(l3, l3Tucked);
final var l4Tucked =
new ExtensionState(
ExtensionKinematics.L4_EXTENSION.elevatorHeightMeters(),
Expand Down Expand Up @@ -124,21 +128,30 @@ public class ExtensionPathing {
new ExtensionState(
ElevatorSubsystem.INTAKE_ALGAE_LOW_EXTENSION,
ShoulderSubsystem.SHOULDER_INTAKE_ALGAE_REEF_POS,
ShoulderSubsystem.SHOULDER_INTAKE_ALGAE_REEF_POS);
WristSubsystem.WRIST_INTAKE_ALGAE_REEF_POS);
graph.addNode(algaeLow);
graph.putEdge(betweenTucked, algaeLow);

final var algaeHigh =
new ExtensionState(
ElevatorSubsystem.INTAKE_ALGAE_HIGH_EXTENSION,
ShoulderSubsystem.SHOULDER_INTAKE_ALGAE_REEF_POS,
ShoulderSubsystem.SHOULDER_INTAKE_ALGAE_REEF_POS);
WristSubsystem.WRIST_INTAKE_ALGAE_REEF_POS);
graph.addNode(algaeHigh);
graph.putEdge(betweenTucked, algaeHigh);
graph.putEdge(algaeLow, algaeHigh);

graph.putEdge(l4Tucked, algaeHigh);
graph.putEdge(l4Tucked, algaeLow);

final var algaeHalfTucked =
new ExtensionState(
Units.inchesToMeters(27.6),
ShoulderSubsystem.SHOULDER_TUCKED_CLEARANCE_POS,
WristSubsystem.WRIST_TUCKED_CLEARANCE_POS);
graph.addNode(algaeHalfTucked);
graph.putEdge(algaeHalfTucked, algaeLow);
graph.putEdge(algaeHalfTucked, algaeHigh);
}

private ExtensionPathing() {}
Expand Down
Loading