Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6458b12
added temporary algae collection logic. Need to test and need targetS…
Nummun14 Sep 18, 2025
24d64e7
Added algae ejection
Nummun14 Sep 18, 2025
bf36334
removed unnecacery things
Nummun14 Sep 18, 2025
9be26f9
Merge branch 'main' into algae-commands
Nummun14 Sep 19, 2025
2175ebf
Merge branch 'main' into algae-commands
Nummun14 Sep 21, 2025
6842f2c
no errors
Nummun14 Sep 21, 2025
ec764d9
Added algae collection states and unload coral command
Nummun14 Sep 21, 2025
d88d93b
oops
Nummun14 Sep 21, 2025
0f9d7db
oops x2
Nummun14 Sep 21, 2025
d906247
added reverse scoring
Nummun14 Sep 21, 2025
63e618f
Update AlgaeManipulationCommands.java
Nummun14 Sep 21, 2025
360cda7
Merge branch 'main' into algae-commands
Nummun14 Sep 24, 2025
47684bf
Logic is logiccccccccccing
Strflightmight09 Sep 25, 2025
5720832
lol
Nummun14 Sep 25, 2025
7592057
W
Strflightmight09 Sep 25, 2025
9537d3e
temporary
Nummun14 Sep 25, 2025
60688dd
some stuff
Strflightmight09 Sep 25, 2025
a4c41fa
added algae to reef, and no loading when robot has algae
Nummun14 Sep 25, 2025
0f94518
Flippable 2.0
Strflightmight09 Sep 25, 2025
ee10305
:)
Nummun14 Sep 25, 2025
9a35efc
Fix algae problem and more
Strflightmight09 Sep 25, 2025
c653954
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Strflightmight09 Sep 25, 2025
d58b841
Made work
Strflightmight09 Sep 25, 2025
02f4c91
fixed algae collection ending bug
Nummun14 Sep 25, 2025
28ab418
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Nummun14 Sep 25, 2025
f6042fb
It picks it up now
Strflightmight09 Sep 25, 2025
95e944b
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Strflightmight09 Sep 25, 2025
20ce80e
Just the dropping.....
Strflightmight09 Sep 25, 2025
f59a54d
is adding a boolean event rlly that hard @Strflightmight09 ?
Nummun14 Sep 25, 2025
2799d9c
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Strflightmight09 Sep 25, 2025
8c79424
lol
Nummun14 Sep 25, 2025
3b97a1b
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Nummun14 Sep 25, 2025
0f756d2
added proc and net locationsd
Nummun14 Sep 25, 2025
e452d1b
ugly solutions go brrrrrrr
Nummun14 Sep 25, 2025
e942e88
Commit because I'm goateaddd
Strflightmight09 Sep 25, 2025
dd399f0
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Strflightmight09 Sep 25, 2025
b9fc291
processor sim works!
Nummun14 Sep 26, 2025
3ac3afb
net works
Nummun14 Sep 26, 2025
eba36bb
added pid controller
Nummun14 Sep 26, 2025
6e36c6f
ver yyes
Strflightmight09 Sep 26, 2025
ee1ae18
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Strflightmight09 Sep 26, 2025
bc006a4
code rabbit is actually op
Nummun14 Sep 26, 2025
4eff751
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Nummun14 Sep 26, 2025
7ff39e8
s
Strflightmight09 Sep 26, 2025
202c4bd
Merge branch 'algae-commands' of https://github.com/Programming-TRIGO…
Strflightmight09 Sep 26, 2025
5861571
Networks
Strflightmight09 Sep 26, 2025
a49c49f
Super cool stuff
Strflightmight09 Sep 26, 2025
6662ca8
dumb stuff
Nummun14 Sep 26, 2025
2e4beb9
no need
Nummun14 Sep 26, 2025
62dd446
The commit to fix all commits
Strflightmight09 Sep 26, 2025
cf9ddea
lamb duh
Strflightmight09 Sep 26, 2025
4122b01
Merge branch 'main' into algae-commands
Nummun14 Sep 27, 2025
c6ddc98
Update ArmElevatorConstants.java
Nummun14 Sep 27, 2025
8c05c04
no erros, still need to test though
Nummun14 Sep 27, 2025
d8947fd
Some small things racked up
Strflightmight09 Sep 27, 2025
7323b27
Merge branch 'main' into algae-commands
Strflightmight09 Sep 28, 2025
64db523
Fix
Strflightmight09 Sep 28, 2025
3e7189a
Cool stuff
Strflightmight09 Sep 28, 2025
7cdf12c
Remove LEDs
Strflightmight09 Sep 28, 2025
0a34c02
updated coral placing commands to use flippable arm overide command
ShmayaR Sep 29, 2025
8491f00
scores algae again
Strflightmight09 Sep 30, 2025
fbedb8f
collection works
Strflightmight09 Sep 30, 2025
0fc0c01
no more jerking
Strflightmight09 Sep 30, 2025
a65a34b
no jerk
Strflightmight09 Sep 30, 2025
01e7b00
Merge branch 'main' into algae-commands
Strflightmight09 Sep 30, 2025
07840d4
no erros
Strflightmight09 Sep 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
17 changes: 10 additions & 7 deletions src/main/java/frc/trigon/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
package frc.trigon.robot;

import com.pathplanner.lib.auto.AutoBuilder;
import edu.wpi.first.math.geometry.Pose3d;
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.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.PathPlannerConstants;
import frc.trigon.robot.misc.objectdetectioncamera.ObjectPoseEstimator;
import frc.trigon.robot.misc.simulatedfield.SimulatedGamePieceConstants;
import frc.trigon.robot.misc.simulatedfield.SimulationFieldHandler;
Expand Down Expand Up @@ -92,21 +91,25 @@ private void bindDefaultCommands() {
private void initializeGeneralSystems() {
Flippable.init();
LEDConstants.init();
PathPlannerConstants.init();
AutonomousConstants.init();
}

private void bindControllerCommands() {
OperatorConstants.RESET_HEADING_TRIGGER.onTrue(CommandConstants.RESET_HEADING_COMMAND);
OperatorConstants.DRIVE_FROM_DPAD_TRIGGER.whileTrue(CommandConstants.SELF_RELATIVE_DRIVE_FROM_DPAD_COMMAND);
// OperatorConstants.DRIVE_FROM_DPAD_TRIGGER.whileTrue(CommandConstants.SELF_RELATIVE_DRIVE_FROM_DPAD_COMMAND);
OperatorConstants.TOGGLE_BRAKE_TRIGGER.onTrue(GeneralCommands.getToggleBrakeCommand());

OperatorConstants.SPAWN_CORAL_TRIGGER.onTrue(new InstantCommand(() -> SimulationFieldHandler.updateCoralSpawning(new Pose3d(ROBOT_POSE_ESTIMATOR.getEstimatedRobotPose()))));
OperatorConstants.CORAL_COLLECTION_TRIGGER.whileTrue(CoralCollectionCommands.getCoralCollectionCommand());
OperatorConstants.FLOOR_ALGAE_COLLECTION_TRIGGER.toggleOnTrue(AlgaeManipulationCommands.getFloorAlgaeCollectionCommand());
OperatorConstants.REEF_ALGAE_COLLECTION_TRIGGER.toggleOnTrue(AlgaeManipulationCommands.getReefAlgaeCollectionCommand());

OperatorConstants.EJECT_CORAL_TRIGGER.whileTrue(CoralEjectionCommands.getCoralEjectionCommand());
OperatorConstants.CORAL_COLLECTION_TRIGGER.whileTrue(CoralCollectionCommands.getCoralCollectionCommand());
OperatorConstants.SCORE_CORAL_LEFT_TRIGGER.whileTrue(CoralPlacingCommands.getScoreInReefCommand(false));
OperatorConstants.SCORE_CORAL_RIGHT_TRIGGER.whileTrue(CoralPlacingCommands.getScoreInReefCommand(true));
OperatorConstants.EJECT_CORAL_TRIGGER.whileTrue(CoralEjectionCommands.getCoralEjectionCommand());

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.CLIMB_TRIGGER.toggleOnTrue(ClimbCommands.getClimbCommand());
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/trigon/robot/commands/CommandConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import edu.wpi.first.wpilibj2.command.InstantCommand;
import frc.trigon.robot.RobotContainer;
import frc.trigon.robot.commands.commandfactories.GeneralCommands;
import frc.trigon.robot.constants.AutonomousConstants;
import frc.trigon.robot.constants.OperatorConstants;
import frc.trigon.robot.constants.PathPlannerConstants;
import frc.trigon.robot.subsystems.swerve.SwerveCommands;
import lib.commands.CameraPositionCalculationCommand;
import lib.commands.WheelRadiusCharacterizationCommand;
Expand Down Expand Up @@ -45,7 +45,7 @@ public class CommandConstants {
() -> calculateRotationStickAxisValue(DRIVER_CONTROLLER.getRightX())
),
WHEEL_RADIUS_CHARACTERIZATION_COMMAND = new WheelRadiusCharacterizationCommand(
PathPlannerConstants.ROBOT_CONFIG.moduleLocations,
AutonomousConstants.ROBOT_CONFIG.moduleLocations,
RobotContainer.SWERVE::getDriveWheelPositionsRadians,
() -> RobotContainer.SWERVE.getHeading().getRadians(),
(omegaRadiansPerSecond) -> RobotContainer.SWERVE.selfRelativeDriveWithoutSetpointGeneration(new ChassisSpeeds(0, 0, omegaRadiansPerSecond), null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import edu.wpi.first.wpilibj2.command.*;
import frc.trigon.robot.RobotContainer;
import frc.trigon.robot.commands.commandfactories.GeneralCommands;
import frc.trigon.robot.constants.PathPlannerConstants;
import frc.trigon.robot.constants.AutonomousConstants;
import frc.trigon.robot.misc.objectdetectioncamera.ObjectPoseEstimator;
import frc.trigon.robot.subsystems.swerve.SwerveCommands;
import lib.utilities.flippable.FlippableRotation2d;
Expand Down Expand Up @@ -44,24 +44,24 @@ public static Translation2d calculateDistanceFromTrackedGamePiece() {
final Translation2d robotToGamePiece = robotPose.getTranslation().minus(trackedObjectPositionOnField);
var distanceFromTrackedGamePiece = robotToGamePiece.rotateBy(robotPose.getRotation().unaryMinus());
Logger.recordOutput("GamePieceAutoDrive/DistanceFromTrackedGamePiece", distanceFromTrackedGamePiece);
Logger.recordOutput("GamePieceAutoDrive/XDistanceFromTrackedGamePiece", PathPlannerConstants.GAME_PIECE_AUTO_DRIVE_X_PID_CONTROLLER.getSetpoint().position);
Logger.recordOutput("GamePieceAutoDrive/XDistanceFromTrackedGamePiece", AutonomousConstants.GAME_PIECE_AUTO_DRIVE_X_PID_CONTROLLER.getSetpoint().position);
return distanceFromTrackedGamePiece;
}

public static Command getDriveToGamePieceCommand(Supplier<Translation2d> distanceFromTrackedGamePiece) {
return new SequentialCommandGroup(
new InstantCommand(() -> PathPlannerConstants.GAME_PIECE_AUTO_DRIVE_X_PID_CONTROLLER.reset(distanceFromTrackedGamePiece.get().getX(), RobotContainer.SWERVE.getSelfRelativeVelocity().vxMetersPerSecond)),
new InstantCommand(() -> AutonomousConstants.GAME_PIECE_AUTO_DRIVE_X_PID_CONTROLLER.reset(distanceFromTrackedGamePiece.get().getX(), RobotContainer.SWERVE.getSelfRelativeVelocity().vxMetersPerSecond)),
SwerveCommands.getClosedLoopSelfRelativeDriveCommand(
() -> PathPlannerConstants.GAME_PIECE_AUTO_DRIVE_X_PID_CONTROLLER.calculate(distanceFromTrackedGamePiece.get().getX()),
() -> PathPlannerConstants.GAME_PIECE_AUTO_DRIVE_Y_PID_CONTROLLER.calculate(distanceFromTrackedGamePiece.get().getY()),
() -> AutonomousConstants.GAME_PIECE_AUTO_DRIVE_X_PID_CONTROLLER.calculate(distanceFromTrackedGamePiece.get().getX()),
() -> AutonomousConstants.GAME_PIECE_AUTO_DRIVE_Y_PID_CONTROLLER.calculate(distanceFromTrackedGamePiece.get().getY()),
CoralAutoDriveCommand::calculateTargetAngle
)
);
}

public static boolean shouldMoveTowardsGamePiece(Translation2d distanceFromTrackedGamePiece) {
return distanceFromTrackedGamePiece != null &&
(distanceFromTrackedGamePiece.getNorm() > PathPlannerConstants.AUTO_COLLECTION_INTAKE_OPEN_CHECK_DISTANCE_METERS);//TODO: If intake is open
(distanceFromTrackedGamePiece.getNorm() > AutonomousConstants.AUTO_COLLECTION_INTAKE_OPEN_CHECK_DISTANCE_METERS);//TODO: If intake is open
}

public static FlippableRotation2d calculateTargetAngle() {
Expand Down
Loading
Loading