Skip to content
Open

Dev #29

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0fad1ac
Intake
Strflightmight09 Sep 30, 2025
7b281c2
Commit so people can continue
Strflightmight09 Sep 30, 2025
aff073d
arm tuned
Strflightmight09 Oct 2, 2025
a45d106
fix kg and vis offset
Strflightmight09 Oct 2, 2025
a93400d
fix arm setpoints
Strflightmight09 Oct 2, 2025
8c3a876
changed arm position
Strflightmight09 Oct 3, 2025
48875b7
cleaned intakeCOmmands
Strflightmight09 Oct 3, 2025
f6c5a7c
tuned elevator
Strflightmight09 Oct 3, 2025
6522d8a
Merge branch 'main' into dev
Strflightmight09 Oct 3, 2025
53fc6e1
fix
Strflightmight09 Oct 3, 2025
bfcc454
fixed intake sim
Strflightmight09 Oct 3, 2025
883add7
Merge branch 'main' into dev
Strflightmight09 Oct 3, 2025
5604fa0
increased current limit to 120
ShmayaR Oct 3, 2025
6bdc83d
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
ShmayaR Oct 3, 2025
89a72a6
stuff
ShmayaR Oct 3, 2025
a3a6d42
LOTS OF GOOD STUFF
ShmayaR Oct 3, 2025
456e939
canus on canivore
ShmayaR Oct 5, 2025
3f4d646
push
ShmayaR Oct 5, 2025
204470b
fixed algae
levyishai Oct 5, 2025
779c470
FIX
ShmayaR Oct 5, 2025
26a4e70
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
ShmayaR Oct 5, 2025
ef1d29f
proccessor works
levyishai Oct 5, 2025
d18c2ee
fixec coral and lolipop intake
levyishai Oct 5, 2025
8780d1e
all good
ShmayaR Oct 5, 2025
c09aefc
Update AlgaeManipulationCommands.java
levyishai Oct 5, 2025
c177ea3
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
levyishai Oct 5, 2025
5fe7509
more changes
ShmayaR Oct 5, 2025
98f9216
load coral while driving to pose
levyishai Oct 6, 2025
247c198
PUSH
ShmayaR Oct 6, 2025
94e4b5b
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
ShmayaR Oct 6, 2025
a88fb13
fix some sim stuff and alternate align
levyishai Oct 6, 2025
0f718f0
ji
ShmayaR Oct 6, 2025
0399a40
added more conditions for load coral and added continue trigger for a…
levyishai Oct 7, 2025
937117c
fix
levyishai Oct 7, 2025
8f463be
good changes
levyishai Oct 7, 2025
1c60f7d
added no loading toggle
levyishai Oct 7, 2025
8738ba1
fix load
levyishai Oct 7, 2025
1e5ba97
added reset position commands
levyishai Oct 7, 2025
b3f844c
AHAHAHAHAHAH
levyishai Oct 7, 2025
de3c682
COmmit
ShmayaR Oct 8, 2025
9ee334c
commit
ShmayaR Oct 8, 2025
b15b4dd
faster
ShmayaR Oct 8, 2025
41a47b5
fixed resetting elevator position to not hit print
ShmayaR Oct 8, 2025
7387872
big ass commit
Strflightmight09 Oct 8, 2025
a23d92d
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
Strflightmight09 Oct 8, 2025
401e263
lower predict time
Strflightmight09 Oct 8, 2025
73f8672
log stuff
ShmayaR Oct 8, 2025
f72905c
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
ShmayaR Oct 8, 2025
b30244a
more logging
ShmayaR Oct 8, 2025
0e65033
more log changes
ShmayaR Oct 8, 2025
ac2ca04
fix
ShmayaR Oct 8, 2025
ea633be
p8
ShmayaR Oct 8, 2025
2c0ce29
fix arm falling asleep
ShmayaR Oct 8, 2025
ff18479
fix algae position
ShmayaR Oct 8, 2025
fec5163
dang bro that's 11 files changed. not what you want to see after firs…
ShmayaR Oct 8, 2025
4be96a4
fix
ShmayaR Oct 9, 2025
ab141c8
COMMIT STUFF
ShmayaR Oct 9, 2025
a876e79
fix
levyishai Oct 9, 2025
fa8494f
stupid zBook
levyishai Oct 9, 2025
7ebdf2a
dfretf
ShmayaR Oct 9, 2025
3355f90
Merge branch 'dev' of https://github.com/Programming-TRIGON/RobotCode…
ShmayaR Oct 9, 2025
1a5275c
Update FieldConstants.java
levyishai Oct 9, 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
Empty file removed src/main/deploy/logs/.gitkeep
Empty file.
54 changes: 54 additions & 0 deletions src/main/deploy/pathplanner/paths/Example Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 2.0,
"y": 7.0
},
"prevControl": null,
"nextControl": {
"x": 3.0,
"y": 7.0
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 4.0,
"y": 6.0
},
"prevControl": {
"x": 3.0,
"y": 6.0
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 4.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 400.0,
"maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": true
}
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"driveGearing": 6.12,
"maxDriveSpeed": 4.4,
"driveMotorType": "krakenX60FOC",
"driveCurrentLimit": 100.0,
"driveCurrentLimit": 120.0,
"wheelCOF": 1.6,
"flModuleX": 0.172,
"flModuleY": 0.273,
Expand Down
29 changes: 18 additions & 11 deletions src/main/java/frc/trigon/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,18 @@
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import frc.trigon.robot.commands.CommandConstants;
import frc.trigon.robot.commands.commandfactories.*;
import frc.trigon.robot.constants.AutonomousConstants;
import frc.trigon.robot.constants.CameraConstants;
import frc.trigon.robot.constants.LEDConstants;
import frc.trigon.robot.constants.OperatorConstants;
import frc.trigon.robot.constants.*;
import frc.trigon.robot.misc.objectdetectioncamera.ObjectPoseEstimator;
import frc.trigon.robot.misc.simulatedfield.SimulatedGamePieceConstants;
import frc.trigon.robot.misc.simulatedfield.SimulationFieldHandler;
import frc.trigon.robot.poseestimation.poseestimator.PoseEstimator;
import frc.trigon.robot.subsystems.MotorSubsystem;
import frc.trigon.robot.subsystems.armelevator.ArmElevator;
import frc.trigon.robot.subsystems.armelevator.ArmElevatorCommands;
import frc.trigon.robot.subsystems.armelevator.ArmElevatorConstants;
import frc.trigon.robot.subsystems.climber.Climber;
import frc.trigon.robot.subsystems.climber.ClimberCommands;
import frc.trigon.robot.subsystems.climber.ClimberConstants;
import frc.trigon.robot.subsystems.endeffector.EndEffector;
import frc.trigon.robot.subsystems.endeffector.EndEffectorCommands;
import frc.trigon.robot.subsystems.endeffector.EndEffectorConstants;
import frc.trigon.robot.subsystems.intake.Intake;
import frc.trigon.robot.subsystems.intake.IntakeCommands;
import frc.trigon.robot.subsystems.intake.IntakeConstants;
Expand All @@ -45,7 +39,7 @@

public class RobotContainer {
public static final PoseEstimator ROBOT_POSE_ESTIMATOR = new PoseEstimator(
CameraConstants.INTAKE_SIDE_REEF_TAG_CAMERA,
CameraConstants.FRONT_REEF_TAG_CAMERA,
CameraConstants.LEFT_REEF_TAG_CAMERA,
CameraConstants.RIGHT_REEF_TAG_CAMERA
);
Expand Down Expand Up @@ -80,13 +74,14 @@ public Command getAutonomousCommand() {
private void configureBindings() {
bindDefaultCommands();
bindControllerCommands();
// configureSysIDBindings(ARM_ELEVATOR);
}

private void bindDefaultCommands() {
SWERVE.setDefaultCommand(GeneralCommands.getFieldRelativeDriveCommand());
ARM_ELEVATOR.setDefaultCommand(ArmElevatorCommands.getDefaultCommand());
CLIMBER.setDefaultCommand(ClimberCommands.getSetTargetStateCommand(ClimberConstants.ClimberState.REST));
END_EFFECTOR.setDefaultCommand(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.REST));
CLIMBER.setDefaultCommand(ClimberCommands.getDefaultCommand());
END_EFFECTOR.setDefaultCommand(EndEffectorCommands.getDefaultCommand());
INTAKE.setDefaultCommand(IntakeCommands.getSetTargetStateCommand(IntakeConstants.IntakeState.REST));
TRANSPORTER.setDefaultCommand(TransporterCommands.getSetTargetStateCommand(TransporterConstants.TransporterState.REST));
}
Expand Down Expand Up @@ -118,7 +113,15 @@ private void bindControllerCommands() {
OperatorConstants.SPAWN_CORAL_IN_SIMULATION_TRIGGER.onTrue(new InstantCommand(() -> SimulationFieldHandler.updateCoralSpawning(ROBOT_POSE_ESTIMATOR.getEstimatedRobotPose())));
OperatorConstants.FLIP_ARM_TRIGGER.onTrue(new InstantCommand(() -> OperatorConstants.SHOULD_FLIP_ARM_OVERRIDE = !OperatorConstants.SHOULD_FLIP_ARM_OVERRIDE));
OperatorConstants.LOLLIPOP_ALGAE_TOGGLE_TRIGGER.onTrue(new InstantCommand(AlgaeManipulationCommands::toggleLollipopCollection));
OperatorConstants.SHOULD_LOAD_CORAL_TOGGLE_TRIGGER.onTrue(GeneralCommands.getToggleShouldLoadCoralCommand());
OperatorConstants.SHOULD_MANIPULATE_CORAL_ATONOMOUSLY_TRIGGER.onTrue(GeneralCommands.getToggleShouldManipulateCoralAutonomouslyCommand());
OperatorConstants.SHOULD_COLLECT_CORAL_ATONOMOUSLY_TRIGGER.onTrue(GeneralCommands.getToggleShouldCollectCoralAtonomouslyCommand());
OperatorConstants.SHOULD_SCORE_CORAL_ATONOMOUSLY_TRIGGER.onTrue(GeneralCommands.getToggleShouldScoreCoralAtonomouslyCommand());
OperatorConstants.CLIMB_TRIGGER.toggleOnTrue(ClimbCommands.getClimbCommand());
// OperatorConstants.DEBUGGING_TRIGGER.whileTrue(ClimberCommands.getDebuggingCommand());
OperatorConstants.RESET_CLIMBER_POSITION_TRIGGER.whileTrue(ClimberCommands.resetClimberPositionCommand().ignoringDisable(true));
OperatorConstants.RESET_INTAKE_POSITION_TRIGGER.whileTrue(IntakeCommands.resetIntakePositionCommand().ignoringDisable(true));
OperatorConstants.RESET_ELEVATOR_POSITION_TRIGGER.whileTrue(ArmElevatorCommands.resetElevatorPositionCommand().ignoringDisable(true));
}

private void configureSysIDBindings(MotorSubsystem subsystem) {
Expand Down Expand Up @@ -161,7 +164,11 @@ private void buildAutoChooser() {

addCommandsToChooser(
AutonomousCommands.getFloorAutonomousCommand(true),
AutonomousCommands.getFloorAutonomousCommand(false)
AutonomousCommands.getFloorAutonomousCommand(false),
AutonomousCommands.getFloorAutonomousCommand(true, FieldConstants.ReefClockPosition.REEF_2_OCLOCK, FieldConstants.ReefClockPosition.REEF_4_OCLOCK),
AutonomousCommands.getFloorAutonomousCommand(false, FieldConstants.ReefClockPosition.REEF_8_OCLOCK, FieldConstants.ReefClockPosition.REEF_10_OCLOCK),
AutonomousCommands.getFloorAutonomousCommand(true, FieldConstants.ReefClockPosition.REEF_2_OCLOCK, FieldConstants.ReefClockPosition.REEF_4_OCLOCK, FieldConstants.ReefClockPosition.REEF_6_OCLOCK),
AutonomousCommands.getFloorAutonomousCommand(false, FieldConstants.ReefClockPosition.REEF_8_OCLOCK, FieldConstants.ReefClockPosition.REEF_10_OCLOCK, FieldConstants.ReefClockPosition.REEF_6_OCLOCK)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class IntakeAssistCommand extends ParallelCommandGroup {
static final ProfiledPIDController
X_PID_CONTROLLER = RobotHardwareStats.isSimulation() ?
new ProfiledPIDController(0.5, 0, 0, new TrapezoidProfile.Constraints(2.8, 5)) :
new ProfiledPIDController(2.4, 0, 0, new TrapezoidProfile.Constraints(2.65, 5.5)),
new ProfiledPIDController(0.7, 0, 0, new TrapezoidProfile.Constraints(2.65, 4.5)),
Y_PID_CONTROLLER = RobotHardwareStats.isSimulation() ?
new ProfiledPIDController(0.5, 0, 0, new TrapezoidProfile.Constraints(2.8, 5)) :
new ProfiledPIDController(0.3, 0, 0.03, new TrapezoidProfile.Constraints(2.65, 5.5)),
new ProfiledPIDController(0.25, 0, 0.03, new TrapezoidProfile.Constraints(2.65, 4)),
THETA_PID_CONTROLLER = RobotHardwareStats.isSimulation() ?
new ProfiledPIDController(0.4, 0, 0, new TrapezoidProfile.Constraints(2.8, 5)) :
new ProfiledPIDController(2.4, 0, 0, new TrapezoidProfile.Constraints(2.65, 5.5));
new ProfiledPIDController(0.6, 0, 0, new TrapezoidProfile.Constraints(2.8, 4.5));
private Translation2d distanceFromTrackedGamePiece;

/**
Expand Down Expand Up @@ -96,8 +96,8 @@ private static Translation2d calculateTranslationPower(AssistMode assistMode, Tr
final double xPIDOutput = clampToOutputRange(X_PID_CONTROLLER.calculate(distanceFromTrackedGamePiece.getX()));
final double yPIDOutput = clampToOutputRange(Y_PID_CONTROLLER.calculate(distanceFromTrackedGamePiece.getY()));

if (assistMode.equals(AssistMode.ALTERNATE_ASSIST))
return calculateAlternateAssistTranslationPower(selfRelativeJoystickPower, xPIDOutput, yPIDOutput);
if (assistMode.isAlternate)
return calculateAlternateAssistTranslationPower(assistMode, selfRelativeJoystickPower, xPIDOutput, yPIDOutput);
return calculateNormalAssistTranslationPower(assistMode, selfRelativeJoystickPower, xPIDOutput, yPIDOutput, intakeAssistScalar);
}

Expand All @@ -115,14 +115,13 @@ private static double calculateThetaPower(AssistMode assistMode, Translation2d d
return pow;
}

private static Translation2d calculateAlternateAssistTranslationPower(Translation2d joystickValue, double xPIDOutput, double yPIDOutput) {
final double pidScalar = Math.cbrt(joystickValue.getNorm());
private static Translation2d calculateAlternateAssistTranslationPower(AssistMode assistMode, Translation2d joystickValue, double xPIDOutput, double yPIDOutput) {
final double
xJoystickPower = Math.cbrt(joystickValue.getX()),
yJoystickPower = Math.cbrt(joystickValue.getY());
xJoystickPower = joystickValue.getX(),
yJoystickPower = joystickValue.getY();
final double
xPower = calculateAlternateAssistPower(xPIDOutput, pidScalar, xJoystickPower),
yPower = calculateAlternateAssistPower(yPIDOutput, pidScalar, yJoystickPower);
xPower = assistMode.shouldAssistX ? calculateAlternateAssistPower(xPIDOutput, xJoystickPower) : xJoystickPower,
yPower = assistMode.shouldAssistY ? calculateAlternateAssistPower(yPIDOutput, yJoystickPower) : yJoystickPower;

return new Translation2d(xPower, yPower);
}
Expand All @@ -143,17 +142,17 @@ private static double calculateThetaAssistPower(AssistMode assistMode, Rotation2
pidOutput = clampToOutputRange(THETA_PID_CONTROLLER.calculate(thetaOffset.getRadians())),
joystickValue = OperatorConstants.DRIVER_CONTROLLER.getRightX();

if (assistMode.equals(AssistMode.ALTERNATE_ASSIST))
return calculateAlternateAssistPower(pidOutput, joystickValue, joystickValue);
if (assistMode.isAlternate)
return calculateAlternateAssistPower(pidOutput, joystickValue);
return calculateNormalAssistPower(pidOutput, joystickValue, intakeAssistScalar);
}

private static double clampToOutputRange(double value) {
return MathUtil.clamp(value, -1, 1);
}

private static double calculateAlternateAssistPower(double pidOutput, double pidScalar, double joystickPower) {
return pidOutput * (1 - Math.abs(pidScalar)) + joystickPower;
private static double calculateAlternateAssistPower(double pidOutput, double joystickPower) {
return pidOutput * (1 - Math.abs(joystickPower)) + joystickPower;
}

private static double calculateNormalAssistPower(double pidOutput, double joystickPower, double scalar) {
Expand All @@ -162,6 +161,7 @@ private static double calculateNormalAssistPower(double pidOutput, double joysti

private static void resetPIDControllers(Translation2d distanceFromTrackedGamePiece) {
X_PID_CONTROLLER.reset(distanceFromTrackedGamePiece.getX(), RobotContainer.SWERVE.getSelfRelativeVelocity().vxMetersPerSecond);
X_PID_CONTROLLER.setGoal(-0.15);
Y_PID_CONTROLLER.reset(distanceFromTrackedGamePiece.getY(), RobotContainer.SWERVE.getSelfRelativeVelocity().vyMetersPerSecond);
THETA_PID_CONTROLLER.reset(distanceFromTrackedGamePiece.getAngle().plus(Rotation2d.k180deg).unaryMinus().getRadians(), RobotContainer.SWERVE.getSelfRelativeVelocity().omegaRadiansPerSecond);
}
Expand All @@ -173,29 +173,35 @@ public enum AssistMode {
/**
* An alternate method for assisting the intake where the pid output is scaled down the more input the driver gives.
*/
ALTERNATE_ASSIST(true, true, true),
ALTERNATE_ASSIST(true, true, true, true),
/**
* An alternate method for assisting the intake where the pid output is scaled down the more input the driver gives.
*/
ALTERNATE_ALIGN(false, true, true, true),
/**
* Applies pid values to autonomously drive to the game piece, scaled by the intake assist scalar in addition to the driver's inputs
*/
FULL_ASSIST(true, true, true),
FULL_ASSIST(true, true, true, false),
/**
* Applies pid values to align to the game piece, scaled by the intake assist scalar in addition to the driver's inputs
*/
ALIGN_ASSIST(false, true, true),
ALIGN_ASSIST(false, true, true, false),
/**
* Applies pid values to face the game piece, scaled by the intake assist scalar in addition to the driver's inputs
*/
ASSIST_ROTATION(false, false, true);
ASSIST_ROTATION(false, false, true, false);

final boolean
shouldAssistX,
shouldAssistY,
shouldAssistTheta;
shouldAssistTheta,
isAlternate;

AssistMode(boolean shouldAssistX, boolean shouldAssistY, boolean shouldAssistTheta) {
AssistMode(boolean shouldAssistX, boolean shouldAssistY, boolean shouldAssistTheta, boolean isAlternate) {
this.shouldAssistX = shouldAssistX;
this.shouldAssistY = shouldAssistY;
this.shouldAssistTheta = shouldAssistTheta;
this.isAlternate = isAlternate;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static Command getFloorAlgaeCollectionCommand() {
return new SequentialCommandGroup(
GeneralCommands.getResetFlipArmOverrideCommand(),
CoralCollectionCommands.getUnloadCoralCommand().onlyIf(RobotContainer.END_EFFECTOR::hasGamePiece),
getInitiateFloorAlgaeCollectionCommand().until(RobotContainer.END_EFFECTOR::hasGamePiece),
getInitiateFloorAlgaeCollectionCommand().raceWith(new WaitUntilCommand(RobotContainer.END_EFFECTOR::hasGamePiece).andThen(new WaitCommand(0.1))),
new InstantCommand(() -> {
IS_HOLDING_ALGAE = true;
SHOULD_COLLECT_FROM_LOLLIPOP = false;
Expand All @@ -64,7 +64,7 @@ public static Command getReefAlgaeCollectionCommand() {
return new SequentialCommandGroup(
GeneralCommands.getResetFlipArmOverrideCommand(),
CoralCollectionCommands.getUnloadCoralCommand().onlyIf(RobotContainer.END_EFFECTOR::hasGamePiece),
getInitiateReefAlgaeCollectionCommand().until(RobotContainer.END_EFFECTOR::hasGamePiece),
getInitiateReefAlgaeCollectionCommand().raceWith(new WaitUntilCommand(RobotContainer.END_EFFECTOR::hasGamePiece).andThen(new WaitCommand(0.1))),
new InstantCommand(() -> IS_HOLDING_ALGAE = true),
GeneralCommands.getResetFlipArmOverrideCommand(),
getScoreAlgaeCommand().alongWith(getAlgaeCollectionConfirmationCommand())
Expand Down Expand Up @@ -110,6 +110,13 @@ private static Command getHoldAlgaeCommand() {
}

private static Command getScoreInNetCommand() {
return new ParallelRaceGroup(
GeneralCommands.getFlippableOverridableArmCommand(ArmElevatorConstants.ArmElevatorState.SCORE_NET, false, AlgaeManipulationCommands::shouldReverseNetScore),
GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER)
);
}
Comment on lines 112 to +117
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Scoring race may never finish; add an ejection-complete condition.

Both subcommands are effectively non-terminating. Race will only end if externally canceled. Add a “piece left” condition to auto-finish.

-        return new ParallelRaceGroup(
+        return new ParallelRaceGroup(
                 GeneralCommands.getFlippableOverridableArmCommand(ArmElevatorConstants.ArmElevatorState.SCORE_NET, false, AlgaeManipulationCommands::shouldReverseNetScore),
                 GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER)
-        );
+        )
+        .raceWith(new WaitUntilCommand(() -> !RobotContainer.END_EFFECTOR.hasGamePiece()).andThen(new WaitCommand(0.2)));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private static Command getScoreInNetCommand() {
return new ParallelRaceGroup(
GeneralCommands.getFlippableOverridableArmCommand(ArmElevatorConstants.ArmElevatorState.SCORE_NET, false, AlgaeManipulationCommands::shouldReverseNetScore),
GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER)
);
}
private static Command getScoreInNetCommand() {
return new ParallelRaceGroup(
GeneralCommands.getFlippableOverridableArmCommand(ArmElevatorConstants.ArmElevatorState.SCORE_NET, false, AlgaeManipulationCommands::shouldReverseNetScore),
GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER)
)
.raceWith(
new WaitUntilCommand(() -> !RobotContainer.END_EFFECTOR.hasGamePiece())
.andThen(new WaitCommand(0.2))
);
}
🤖 Prompt for AI Agents
In
src/main/java/frc/trigon/robot/commands/commandfactories/AlgaeManipulationCommands.java
around lines 112 to 117, the ParallelRaceGroup created for getScoreInNetCommand
currently contains two long-running/non-terminating commands so the race can
never finish on its own; add a third terminating condition that completes the
race when the piece has been ejected (a “piece left” / ejection-complete check).
Implement this by adding a short-lived command or a
GeneralCommands.runWhen-style wrapper that watches the end-effector sensor/state
(e.g., a BooleanSupplier that returns false when no piece is present or a new
EndEffectorCommands.getWaitForPieceRemovedCommand()) and include it as another
entry in the ParallelRaceGroup so the group ends automatically when the piece is
detected as removed.


private static Command getAutonomouslyScoreInNetCommand() {
return new ParallelRaceGroup(
GeneralCommands.getFlippableOverridableArmCommand(ArmElevatorConstants.ArmElevatorState.SCORE_NET, false, AlgaeManipulationCommands::shouldReverseNetScore),
GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER),
Expand All @@ -119,7 +126,14 @@ private static Command getScoreInNetCommand() {

private static Command getScoreInProcessorCommand() {
return new ParallelCommandGroup(
GeneralCommands.getFlippableOverridableArmCommand(ArmElevatorConstants.ArmElevatorState.SCORE_PROCESSOR, false),
ArmElevatorCommands.getSetTargetStateCommand(ArmElevatorConstants.ArmElevatorState.SCORE_PROCESSOR),
GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER)
).finallyDo(GeneralCommands.getFieldRelativeDriveCommand()::schedule);
}

private static Command getAtonomouslyScoreInProcessorCommand() {
return new ParallelCommandGroup(
ArmElevatorCommands.getSetTargetStateCommand(ArmElevatorConstants.ArmElevatorState.SCORE_PROCESSOR),
GeneralCommands.runWhen(EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.SCORE_ALGAE), OperatorConstants.CONTINUE_TRIGGER),
getDriveToProcessorCommand()
).finallyDo(GeneralCommands.getFieldRelativeDriveCommand()::schedule);
Expand Down Expand Up @@ -181,7 +195,7 @@ private static Command getCollectAlgaeFromLollipopSequenceCommand() {
.onlyIf(() -> OperatorConstants.SHOULD_FLIP_ARM_OVERRIDE)
.until(() -> !OperatorConstants.SHOULD_FLIP_ARM_OVERRIDE)
.repeatedly()
);
).finallyDo(() -> SHOULD_COLLECT_FROM_LOLLIPOP = false);
}

private static Command getCollectAlgaeFromFloorSequenceCommand() {
Expand Down
Loading
Loading