Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c6c583f
Added auto aim shoot mode
JAMthepersonj Mar 31, 2026
3c87755
added fast depot sequence, updated fast depot path, autochooser and a…
michaelk036 Mar 31, 2026
cd0ad99
having issues with choreo not going to where we tell it to go
michaelk036 Apr 1, 2026
ba0eec9
Changed P of drive command WIP
JAMthepersonj Apr 1, 2026
6d0c385
Chnaged angler turret and angler reset speeds
JAMthepersonj Apr 1, 2026
fa6bd26
Updated shuttling target locations
the-sun-x Apr 1, 2026
da05caa
Added correct shooter formulas for into the hub shooting
JAMthepersonj Apr 2, 2026
c65b21b
changed the path, changed the pid for the choreo drive
michaelk036 Apr 2, 2026
7bf9c34
changed max velocity to 2
michaelk036 Apr 2, 2026
0f93f57
oops i didn't generate the path
michaelk036 Apr 2, 2026
16c98a5
Changed drive Command P and made chero great again
JAMthepersonj Apr 2, 2026
687c755
Merge branch 'WPI-branch' of https://github.com/FRC4048/Java_2026 int…
michaelk036 Apr 2, 2026
341f1bf
changed path, changed sequence
michaelk036 Apr 2, 2026
1c80db9
made robot go closer to depot in path
michaelk036 Apr 2, 2026
fe2a910
Fixed depot shoot intake
JAMthepersonj Apr 2, 2026
8cd636d
Removed loggable wait
JAMthepersonj Apr 2, 2026
9c67dd2
Fixed fast depot sequence
JAMthepersonj Apr 2, 2026
f5bf117
changed path to stop further away from the intake
michaelk036 Apr 2, 2026
9143d32
Merge branch 'WPI-branch' of https://github.com/FRC4048/Java_2026 int…
michaelk036 Apr 2, 2026
fd755f4
1.8 max velocity, 0.8 max acceleration
michaelk036 Apr 3, 2026
314af1f
generated the path
michaelk036 Apr 3, 2026
9b852d0
Made depot shoot work and chnaged the auto chooser names
JAMthepersonj Apr 3, 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
126 changes: 126 additions & 0 deletions src/main/deploy/choreo/Depot_Fast.traj

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/main/java/frc/robot/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@


public class Drive extends SubsystemBase{
private final PIDController xController = new PIDController(.01, 0.0, 0.0);
private final PIDController yController = new PIDController(.01, 0.0, 0.0);
private final PIDController headingController = new PIDController(.01, 0.0, 0.0);
private final PIDController xController = new PIDController(10, 0.0, 0.0);
private final PIDController yController = new PIDController(10, 0.0, 0.0);
private final PIDController headingController = new PIDController(5, 0.0, 0.0);
private SwerveSubsystem subsystem;

public Drive(SwerveSubsystem subsystem) {
Expand All @@ -29,7 +29,7 @@ public void followTrajectory(SwerveSample sample) {
);

ChassisSpeeds robotRelativeSpeeds =
ChassisSpeeds.fromRobotRelativeSpeeds(fieldRelativeSpeeds, pose.getRotation());
ChassisSpeeds.fromFieldRelativeSpeeds(fieldRelativeSpeeds, pose.getRotation());
subsystem.setChassisSpeeds(robotRelativeSpeeds);

}
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ private void configureBindings() {
}

public void putShuffleboardCommands() {
SmartDashboard.putData(
"intakedeployer/Deployment State: UP",
new SetDeploymentState(intakeDeployer, DeploymentState.UP));
SmartDashboard.putData(
"intakedeployer/Deployment State: DOWN",
new SetDeploymentState(intakeDeployer, DeploymentState.DOWN));
SmartDashboard.putData(
"Shooting State: Auto aim",
new SetShootingState(shootState, ShootState.AUTO_AIM));

if (Constants.DEBUG) {
SmartDashboard.putNumber(RunDashboardShotTest.ANGLER_TARGET_POSITION_KEY, 0.0);
SmartDashboard.putNumber(RunDashboardShotTest.SHOOTER_TARGET_RPM_KEY, Constants.SHOOTER_SPEED);
Expand Down Expand Up @@ -508,12 +518,6 @@ public void putShuffleboardCommands() {
SmartDashboard.putData(
"Shooting State: Shuttling",
new SetShootingState(shootState, ShootState.SHUTTLING));
SmartDashboard.putData(
"intakedeployer/Deployment State: UP",
new SetDeploymentState(intakeDeployer, DeploymentState.UP));
SmartDashboard.putData(
"intakedeployer/Deployment State: DOWN",
new SetDeploymentState(intakeDeployer, DeploymentState.DOWN));
SmartDashboard.putData(
"intakedeployer/Deployment State: STOPPED",
new SetDeploymentState(intakeDeployer, DeploymentState.STOPPED));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/apriltags/SimApriltagIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void simReadings() {
if (cosIncidenceAngle!=0 && distance / cosIncidenceAngle < Constants.MAX_VISION_DISTANCE_SIMULATION) {
VisionMeasurement measurement = new VisionMeasurement(new Pose2d(), distance, 0, 0);
Vector<N3> stdDevs = truster.calculateTrust(measurement);
double readingX = pose.getX() + random.nextGaussian() * stdDevs.get(0);
double readingY = pose.getY() + random.nextGaussian() * stdDevs.get(1);
double readingX = pose.getX(); //+ random.nextGaussian() * stdDevs.get(0);
double readingY = pose.getY(); //+ random.nextGaussian() * stdDevs.get(1);
double readingYaw = pose.getRotation().getDegrees() + random.nextGaussian() * stdDevs.get(2);
Pose2d readingPos = new Pose2d(readingX, readingY, Rotation2d.fromDegrees(readingYaw));
distance = readingPos.getTranslation().getDistance(tag.getPose().toPose2d().getTranslation());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/autochooser/AutoAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public enum AutoAction {
DO_NOTHING("Do Nothing"),
SHOOT("Shoot"),
FAST_SHOOT("Shoot depot"),
//SHOOT_PICKUP("Shoot and Pickup"),
//DISTURBANCE("Disturbance"),
//NEUTRAL_ZONE("Shoot and Neutral Zone Pickup"),
Expand Down
16 changes: 13 additions & 3 deletions src/main/java/frc/robot/autochooser/AutoChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import frc.robot.Robot;
import frc.robot.commands.auto.neutral.DepotNeutral;
import frc.robot.commands.auto.neutral.OutpostNeutral;
import frc.robot.commands.auto.newauto.FastDepotRed;
import frc.robot.commands.auto.newauto.FastDepotBlue;
import frc.robot.commands.auto.shoot.ShootBlue;
import frc.robot.commands.auto.shoot.ShootRed;
import frc.robot.commands.auto.disturbance.DepotDisturbance;
Expand Down Expand Up @@ -82,9 +84,9 @@ private void populateChoosers() {
switch (location) {
case INVALID -> {} // Skip the invalid case.
case ZERO -> { // Default
locationChooser.addDefaultOption(location.toString(), location);
locationChooser.addDefaultOption(location.getShuffleboardName(), location);
}
default -> {locationChooser.addOption(location.toString(), location);}
default -> {locationChooser.addOption(location.getShuffleboardName(), location);}
};
}
for (AutoAction action : AutoAction.values()) {
Expand Down Expand Up @@ -125,6 +127,12 @@ private void populateCommandMap() {
new ShootBlue(drivetrain, auto, shooter, shootstate, hopper, feeder, turret, angler, controller, intake));
commandMap.put(new AutoEvent(AutoAction.SHOOT, FieldLocation.OUTPOST_SIDE, Alliance.Blue),
new ShootBlue(drivetrain, auto, shooter, shootstate, hopper, feeder, turret, angler, controller, intake));

commandMap.put(new AutoEvent(AutoAction.FAST_SHOOT, FieldLocation.FAST_DEPOT, Alliance.Red),
new FastDepotRed(drivetrain, auto, shooter, shootstate, hopper, feeder, turret, angler, controller, intake));
commandMap.put(new AutoEvent(AutoAction.FAST_SHOOT, FieldLocation.FAST_DEPOT, Alliance.Blue),
new FastDepotBlue(drivetrain, auto, shooter, shootstate, hopper, feeder, turret, angler, controller, intake));


/*
//shoot-pickup
Expand Down Expand Up @@ -164,6 +172,8 @@ private void populateDescriptionMap() {
"shoot from the middle");
descriptionMap.put(new AutoEvent(AutoAction.SHOOT, FieldLocation.OUTPOST_SIDE),
"shoot from the outpost");
descriptionMap.put(new AutoEvent(AutoAction.FAST_SHOOT, FieldLocation.FAST_DEPOT),
"depot and shoot from the depot");
/*
descriptionMap.put(new AutoEvent(AutoAction.SHOOT_PICKUP, FieldLocation.DEPOT_SIDE),
"shoot and pickup from the depot");
Expand Down Expand Up @@ -204,7 +214,7 @@ public String getCommandDescription() {
return "NO AUTO";
} else {
String commandDescription = descriptionMap.get(event.withoutColor());
return event.getAction() + " at " + event.getLocation() + " " + commandDescription + ".";
return event.getActionName() + " at " + event.getLocation() + " -> " + commandDescription + ".";
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/autochooser/AutoEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public AutoEvent(AutoAction action, FieldLocation location, Alliance color) {
public AutoAction getAction() {
return action;
}
public String getActionName() {
return action.name();
}

public FieldLocation getLocation() {
return location;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/autochooser/FieldLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public enum FieldLocation {
INVALID(-1, -1, -1, "INVALID"),
DEPOT_SIDE(3.599, 7.33, 180, "Depot side - Driver Station LEFT"), //robot is 24 cm away from the wall
MID(3.599, 4.029, 180, "Middle"),
OUTPOST_SIDE(3.599, 0.67, 180, "Outpost side - Driver Station RIGHT"); //robot is 24 cm away from the wall
OUTPOST_SIDE(3.599, 0.67, 180, "Outpost side - Driver Station RIGHT"), //robot is 24 cm away from the wall
FAST_DEPOT(3.596, 5.06, 180, "Depot side - for the fast auto"); //robot's back left corner is next to hopper corner

private static final double RED_X_POS = 9.338; // meters
public static final double HEIGHT_OF_FIELD = 8.043;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/commands/auto/AutoShoot.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package frc.robot.commands.auto;

import frc.robot.commands.feeder.SpinFeeder;
import frc.robot.commands.hopper.AutoSpinHopper;
import frc.robot.commands.hopper.SpinHopper;
import frc.robot.subsystems.FeederSubsystem;
import frc.robot.subsystems.HopperSubsystem;
Expand All @@ -10,7 +11,7 @@
public class AutoShoot extends LoggableRaceCommandGroup{
public AutoShoot(HopperSubsystem hopperSubsystem, FeederSubsystem feederSubsystem, double time){
super(
new SpinHopper(hopperSubsystem),
new AutoSpinHopper(hopperSubsystem),
new SpinFeeder(feederSubsystem),
new LoggableWaitCommand(time)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package frc.robot.commands.auto.newauto;

import choreo.auto.AutoFactory;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.auto.AutoReset;
import frc.robot.commands.auto.AutoShoot;
import frc.robot.commands.drive.DriveSwerve;
import frc.robot.commands.intakeDeployment.ToggleDeployment;
import frc.robot.commands.shooter.SetShootingState;
import frc.robot.constants.enums.DriveDirection;
import frc.robot.constants.enums.ShootingState;
import frc.robot.constants.enums.ShootingState.ShootState;
import frc.robot.subsystems.*;
import frc.robot.subsystems.swervedrive.SwerveSubsystem;
import frc.robot.utils.logging.commands.LoggableCommandWrapper;
import frc.robot.utils.logging.commands.LoggableParallelCommandGroup;
import frc.robot.utils.logging.commands.LoggableSequentialCommandGroup;
import frc.robot.utils.logging.commands.LoggableWaitCommand;

public class FastDepotBlue extends LoggableSequentialCommandGroup {
public FastDepotBlue(
SwerveSubsystem drivetrain, AutoFactory auto, ShooterSubsystem shooter, ShootingState shootstate,
HopperSubsystem hopper, FeederSubsystem feeder, TurretSubsystem turret, AnglerSubsystem angler,
ControllerSubsystem controller, IntakeDeployerSubsystem intake) {
super(
new AutoReset(shootstate, turret, angler),
new SetShootingState(shootstate, ShootState.AUTO_AIM),
new LoggableParallelCommandGroup(
LoggableCommandWrapper.wrap(auto.resetOdometry("Depot_Fast")),
LoggableCommandWrapper.wrap(auto.trajectoryCmd("Depot_Fast"))
),
new AutoShoot(hopper, feeder, 1),
new ToggleDeployment(intake, controller),
new LoggableParallelCommandGroup(
new AutoShoot(hopper, feeder, 20),
new LoggableSequentialCommandGroup(
new DriveSwerve(drivetrain, DriveDirection.FORWARD, 6, 0.2),
new DriveSwerve(drivetrain, DriveDirection.BACKWARD, 0.5, 0.5),
new DriveSwerve(drivetrain, DriveDirection.FORWARD, 7, 0.2),
new ToggleDeployment(intake, controller)
)
)

);
}
}
50 changes: 50 additions & 0 deletions src/main/java/frc/robot/commands/auto/newauto/FastDepotRed.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package frc.robot.commands.auto.newauto;

import choreo.auto.AutoFactory;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.auto.AutoReset;
import frc.robot.commands.auto.AutoShoot;
import frc.robot.commands.drive.DriveSwerve;
import frc.robot.commands.intakeDeployment.ToggleDeployment;
import frc.robot.commands.shooter.SetShootingState;
import frc.robot.constants.enums.DriveDirection;
import frc.robot.constants.enums.ShootingState;
import frc.robot.constants.enums.ShootingState.ShootState;
import frc.robot.subsystems.*;
import frc.robot.subsystems.swervedrive.SwerveSubsystem;
import frc.robot.utils.logging.commands.LoggableCommandWrapper;
import frc.robot.utils.logging.commands.LoggableParallelCommandGroup;
import frc.robot.utils.logging.commands.LoggableSequentialCommandGroup;
import frc.robot.utils.logging.commands.LoggableWaitCommand;

public class FastDepotRed extends LoggableSequentialCommandGroup {
public FastDepotRed(
SwerveSubsystem drivetrain, AutoFactory auto, ShooterSubsystem shooter, ShootingState shootstate,
HopperSubsystem hopper, FeederSubsystem feeder, TurretSubsystem turret, AnglerSubsystem angler,
ControllerSubsystem controller, IntakeDeployerSubsystem intake) {
super(

new LoggableParallelCommandGroup(
new LoggableSequentialCommandGroup(
new AutoReset(shootstate, turret, angler),
new SetShootingState(shootstate, ShootState.AUTO_AIM)
),
LoggableCommandWrapper.wrap(auto.resetOdometry("Depot_Fast")),
LoggableCommandWrapper.wrap(auto.trajectoryCmd("Depot_Fast"))
),
new AutoShoot(hopper, feeder, 1),
new ToggleDeployment(intake, controller),
new LoggableParallelCommandGroup(
new AutoShoot(hopper, feeder, 20),
new LoggableSequentialCommandGroup(
new DriveSwerve(drivetrain, DriveDirection.BACKWARD, 6, 0.2),
new DriveSwerve(drivetrain, DriveDirection.FORWARD, 0.5, 0.5),
new DriveSwerve(drivetrain, DriveDirection.BACKWARD, 7, 0.2),
new ToggleDeployment(intake, controller)
)
)

);
}
}
47 changes: 47 additions & 0 deletions src/main/java/frc/robot/commands/hopper/AutoSpinHopper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package frc.robot.commands.hopper;

import edu.wpi.first.wpilibj.Timer;
import frc.robot.constants.Constants;
import frc.robot.subsystems.HopperSubsystem;
import frc.robot.utils.logging.commands.LoggableCommand;

public class AutoSpinHopper extends LoggableCommand {

public final HopperSubsystem subsystem;
public final Timer timer;


public AutoSpinHopper(HopperSubsystem subsystem){
timer = new Timer();
this.subsystem = subsystem;
addRequirements(subsystem);
}

@Override
public void initialize() {
timer.restart();
}

@Override
public void execute() {
subsystem.setSpeed(Constants.HOPPER_AUTO_SPEED);
}

@Override
public void end(boolean interrupted) {
subsystem.stopMotors();
}

@Override
public boolean isFinished() {
if (timer.hasElapsed(Constants.HOPPER_TIMEOUT)){
return true;
}
else{
return false;
}

}


}
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/commands/lightStrip/SetLed.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public void execute() {
case SHOOTING_HUB:
lightStrip.setPattern(BlinkinPattern.RAINBOW_RAINBOW_PALETTE);
break;
case AUTO_AIM:
lightStrip.setPattern(BlinkinPattern.RAINBOW_LAVA_PALETTE);
break;
case SHUTTLING:
lightStrip.setPattern(BlinkinPattern.GREEN);
break;
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/frc/robot/constants/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum Mode {
public static final boolean ENABLE_LOGGING = true;

//Debugs
public static final boolean DEBUG = false;
public static final boolean DEBUG = true;
public static final boolean ARM_DEBUG = true;

//Joystick
Expand All @@ -47,7 +47,8 @@ public enum Mode {
//Speeds
public static final double INTAKE_SPEED = -0.7;
public static final double INTAKE_REVERSE_SPEED = 0.5;
public static final double HOPPER_SPEED = 0.75;
public static final double HOPPER_SPEED = 0.6;
public static final double HOPPER_AUTO_SPEED = 0.35;
public static final double CLIMBER_SPEED_UP = 0.1;
public static final double CLIMBER_SPEED_DOWN = -0.1;
public static final double FEEDER_SPEED = 1;
Expand Down Expand Up @@ -101,12 +102,12 @@ public enum Mode {
public static final double ANGLER_FF = 0.0;
public static final double ANGLER_HOME_ROTATIONS = 0.0;
public static final double ANGLER_ENCODER_LOW = 0; //Lowest encoder position of Angler
public static final double ANGLER_ENCODER_HIGH = 272; //Highest encoder position of Angler
public static final double ANGLER_ANGLE_LOW = 16; //Lowest angle position of Angler
public static final double ANGLER_ANGLE_HIGH = 37; //Highest angle position of Angler
public static final double ANGLER_ENCODER_HIGH = 265; //Highest encoder position of Angler
public static final double ANGLER_ANGLE_LOW = 17; //Lowest angle position of Angler
public static final double ANGLER_ANGLE_HIGH = 38; //Highest angle position of Angler
public static final double ANGLER_FIXED_ROTATIONS = 0.1; //Fixed encoder position of Angler in Fixed ShootState
public static final double ANGLER_FIXED_ANGLE = 10; //Fixed encoder position of Angler in Fixed ShootState
public static final double ANGLER_LIMIT_SPEED = 0.3;
public static final double ANGLER_LIMIT_SPEED = 0.6;


// turret (pan angle) PID
Expand All @@ -121,8 +122,8 @@ public enum Mode {
public static final double TURRET_ENCODER_MIN = 0; //Lowest encoder position of Turret
public static final double TURRET_ENCODER_MAX = 77; //Highest encoder position of Turret
public static final double TURRET_HOME_ANGLE = 0.0; //Turret facing forward
public static final double TURRET_MIN_ANGLE = -92;
public static final double TURRET_MAX_ANGLE = 92;
public static final double TURRET_MIN_ANGLE = -96;
public static final double TURRET_MAX_ANGLE = 96;
public static final double TURRET_LIMIT_SPEED = 0.2;
public static final double TURRET_OUT_OF_RANGE_FLOP_RPM = -1500.0;
public static final double TURRET_PID_DISTANCE_THRESHOLD = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public enum ShootState {
FIXED, // Shoot from a known location
FIXED_2, // Shoot from another known location
SHOOTING_HUB, // Auto-aim into the hub
SHUTTLING // Auto-aim into alliance zone
SHUTTLING, // Auto-aim into alliance zone
AUTO_AIM //auto aim without hopper and feeder

}

Expand Down
Loading