Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
74fd100
Remove entire robot/lib/swerve folder and replace all references with…
dcao6668 Oct 11, 2025
4e698d8
Remove WheelTracker, Pigeon, SwerveModule, and TalonFxManager from co…
dcao6668 Oct 11, 2025
c208b63
Deprecate RobotState, CancoderManager, AutoPilotCommand and SnapComma…
dcao6668 Oct 11, 2025
d850d45
Deprecate limelight-based vision localization code
dcao6668 Oct 11, 2025
bf54997
Deprecated robot/lib/drivers folder and its classes (CanDeviceId and …
dcao6668 Oct 11, 2025
c37ed3c
reformat to prepare for sysID tuning
dcao6668 Oct 12, 2025
78c351d
feat: automode scaffolding and PIDV, validation on first complex path…
github-0-0 Oct 13, 2025
20803a2
Merge branch 'DCBaseline' of https://github.com/FRC1458/1458Framework…
github-0-0 Oct 13, 2025
fd640cb
fix: pid to pose
github-0-0 Oct 19, 2025
67d0787
tested snap and it work :D
github-0-0 Oct 19, 2025
206d515
minor refactor
github-0-0 Oct 30, 2025
9f4c42c
refactor of the refactor
github-0-0 Oct 30, 2025
db9d7da
feat: sysid tuning for drive-motors, verified on robot.
dcao6668 Nov 25, 2025
5d9227f
Merge branch 'DCBaseline' of https://github.com/FRC1458/1458Framework…
dcao6668 Nov 25, 2025
d3d9245
finetuning steer-drive coupling ratio
dcao6668 Nov 25, 2025
28e5885
Merged from 2025RobotTest
github-0-0 Dec 7, 2025
8b62b6d
Trajectory update soon
github-0-0 Dec 7, 2025
7364323
i think later though
github-0-0 Dec 7, 2025
dd0973a
minor change
github-0-0 Dec 7, 2025
7cb2089
FEAT: SysID Rotation routine and logs
dcao6668 Dec 14, 2025
4ab705e
feat: enable VisualVM to debug RAM issues
dcao6668 Dec 15, 2025
35fff99
feat: add steer motor offsets of the 2nd bot
dcao6668 Dec 15, 2025
76bd01f
feat: add radialDeadband to fix yaw impulse when driver releases stick
dcao6668 Dec 15, 2025
8e71e10
fix kCoupleRatio value for steer/drive coupling
dcao6668 Dec 15, 2025
657d158
Pid to pose borke again
github-0-0 Dec 19, 2025
4985cc7
Fixed pid to pose and a couple more things
github-0-0 Jan 10, 2026
329433f
Merge DCBaseline for sysid stuffs
github-0-0 Jan 10, 2026
19c3d7b
Fixed PIDToPose
github-0-0 Jan 10, 2026
7e53dc4
last few bugs trust
github-0-0 Jan 10, 2026
e4c60a8
Basic Shooter Code
aerospikeengineer Jan 15, 2026
77b51a7
Addiitonal Shooter Changes
aerospikeengineer Jan 17, 2026
96a29e3
sping up
aerospikeengineer Jan 17, 2026
db2419b
Separate Shooters for Each Motor
aerospikeengineer Jan 18, 2026
266fd99
Combined Shooter into one file
aerospikeengineer Jan 21, 2026
84376c5
Commented out Laser logic
aerospikeengineer Jan 21, 2026
5df56d9
akhil ran out of memory so i took over his shooter
github-0-0 Jan 29, 2026
fc777a5
added sim Hopefully this works here we go
github-0-0 Jan 31, 2026
a2e1e34
Merge remote-tracking branch 'Robot2026/main' into Shooter
github-0-0 Jan 31, 2026
6938988
Shooter simulation working
github-0-0 Jan 31, 2026
780135f
hi it has been tested
github-0-0 Feb 3, 2026
0f57de3
there's two now
armaanwithadouble-a Feb 12, 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
24 changes: 1 addition & 23 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,4 @@
"desktop": false,
}
]
}

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "wpilib",
"name": "WPILib Desktop Debug",
"request": "launch",
"desktop": true,
},
{
"type": "wpilib",
"name": "WPILib roboRIO Debug",
"request": "launch",
"desktop": false,
}
]
}
}
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ deploy {
// getTargetTypeClass is a shortcut to get the class type using a string

frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
// Enable VisualVM connection
jvmArgs.add("-Dcom.sun.management.jmxremote=true")
jvmArgs.add("-Dcom.sun.management.jmxremote.port=1198")
jvmArgs.add("-Dcom.sun.management.jmxremote.local.only=false")
jvmArgs.add("-Dcom.sun.management.jmxremote.ssl=false")
jvmArgs.add("-Dcom.sun.management.jmxremote.authenticate=false")
jvmArgs.add("-Djava.rmi.server.hostname=10.14.58.2") // Replace TE.AM with team number
}

// Static files artifact
Expand Down
7 changes: 6 additions & 1 deletion simgui-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
"incKey": 68
},
{
"decKey": 50,
"decayRate": 0.0,
"incKey": 49,
"keyRate": 0.009999999776482582
},
{},
{
"decKey": 52,
"incKey": 51
},
{
"decKey": 74,
"incKey": 76
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/ControlsMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction;
import frc.robot.subsystems.drive.Drive;
import frc.robot.subsystems.drive.ctre.CtreDrive.SysIdRoutineType;
import frc.robot.subsystems.shooter.Shooter;
import edu.wpi.first.wpilibj2.command.Commands;

public class ControlsMapping {
Expand All @@ -21,6 +22,8 @@ public static void mapTeleopCommand() {
controller.rightBumper().whileTrue(Drive.getInstance().autoAlign(false));
controller.x().whileTrue(Drive.getInstance().autopilotAlign(true));
controller.y().whileTrue(Drive.getInstance().autopilotAlign(false));

controller.rightTrigger().whileTrue(Shooter.getInstance().shoot());
}

public static void mapSysId() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import frc.robot.Constants.Controllers;
import frc.robot.subsystems.TelemetryManager;
import frc.robot.subsystems.drive.*;
import frc.robot.subsystems.shooter.Shooter;
import frc.robot.subsystems.vision.VisionDeviceManager;

/**
Expand All @@ -46,6 +47,7 @@ public Robot() {
VisionDeviceManager.getInstance();
}
Drive.getInstance();
Shooter.getInstance();
TelemetryManager.getInstance();
FollowPathCommand.warmupCommand().schedule();
autoChooser = new AutoSelector();
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/frc/robot/lib/control/ProfiledPIDVController.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ public ProfiledPIDVController setMeasurement(double position, double speed) {
}

public double getOutput() {
// if (controller.isContinuous) {
// double errorBound = (controller.maxRange - controller.minRange) / 2.0;
if (controller.isContinuous) {
double errorBound = (controller.maxRange - controller.minRange) / 2.0;

// double goalDelta =
// MathUtil.inputModulus(goal.position - controller.positionMeasurement, -errorBound, errorBound);
// double setpointDelta =
// MathUtil.inputModulus(setpoint.position - controller.positionMeasurement, -errorBound, errorBound);
double goalDelta =
MathUtil.inputModulus(goal.position - controller.positionMeasurement, -errorBound, errorBound);
double setpointDelta =
MathUtil.inputModulus(setpoint.position - controller.positionMeasurement, -errorBound, errorBound);

// goal.position = goalDelta + controller.positionMeasurement;
// setpoint.position = setpointDelta + controller.positionMeasurement;
// }
goal.position = goalDelta + controller.positionMeasurement;
setpoint.position = setpointDelta + controller.positionMeasurement;
}

// Advance profile by one timestep
setpoint = profile.calculate(Constants.DT, setpoint, goal);
Expand Down
170 changes: 170 additions & 0 deletions src/main/java/frc/robot/subsystems/shooter/Shooter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
package frc.robot.subsystems.shooter;

import com.ctre.phoenix6.controls.CoastOut;
import com.ctre.phoenix6.controls.ControlRequest;
import com.ctre.phoenix6.controls.NeutralOut;
import com.ctre.phoenix6.controls.VelocityVoltage;
import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.NeutralModeValue;

import edu.wpi.first.math.system.plant.DCMotor;
import edu.wpi.first.math.system.plant.LinearSystemId;
import edu.wpi.first.util.sendable.SendableBuilder;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.simulation.BatterySim;
import edu.wpi.first.wpilibj.simulation.FlywheelSim;
import edu.wpi.first.wpilibj.simulation.RoboRioSim;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Robot;
import frc.robot.subsystems.TelemetryManager;

public class Shooter extends SubsystemBase {
private static Shooter shooterLeftInstance;
private static Shooter shooterRightInstance;
public static Shooter getLeftInstance() {
if (shooterLeftInstance == null) {
shooterLeftInstance = new Shooter(true);
}
return shooterLeftInstance;
}


public static Shooter getRightInstance() {
if (shooterRightInstance == null) {
shooterRightInstance = new Shooter(false);
}
return shooterRightInstance;
}
private final TalonFX topMotor;
private final TalonFX bottomMotor;
private double lastReadSpeedTop;
private double lastReadSpeedBottom;
private ControlRequest topRequest = new NeutralOut();
private ControlRequest bottomRequest = new NeutralOut();

private FlywheelSim topSim;
private FlywheelSim bottomSim;

private Shooter(boolean left) {
super();

int bottomID;
int topID;

if (left) {
bottomID = ShooterConstants.Motors.BOTTOMLEFT.id;
topID = ShooterConstants.Motors.TOPLEFT.id;
}
else {
bottomID = ShooterConstants.Motors.BOTTOMRIGHT.id;
topID = ShooterConstants.Motors.TOPRIGHT.id;
}

bottomMotor = new TalonFX(bottomID);
bottomMotor.getConfigurator().apply(ShooterConstants.getConfig());
bottomMotor.setNeutralMode(NeutralModeValue.Coast);

topMotor = new TalonFX(topID);
topMotor.getConfigurator().apply(ShooterConstants.getConfig());
topMotor.setNeutralMode(NeutralModeValue.Coast);

if (Robot.isSimulation()) {
topSim = new FlywheelSim(
LinearSystemId.createFlywheelSystem(
DCMotor.getKrakenX60(1),
0.000489000861,
1
), DCMotor.getKrakenX60(1), 0.0);
bottomSim = new FlywheelSim(
LinearSystemId.createFlywheelSystem(
DCMotor.getKrakenX60(1),
0.000489000861,
1
), DCMotor.getKrakenX60(1), 0.0);
}
TelemetryManager.getInstance().addSendable(this);
setDefaultCommand(stop());
}

@Override
public void periodic() {
// Read inputs
lastReadSpeedTop = topMotor.getVelocity().getValueAsDouble();
lastReadSpeedBottom = bottomMotor.getVelocity().getValueAsDouble();
topMotor.setControl(topRequest);
bottomMotor.setControl(bottomRequest);
}

@Override
public void simulationPeriodic() {
topMotor.getSimState().setSupplyVoltage(12);
bottomMotor.getSimState().setSupplyVoltage(12);

topSim.setInput(topMotor.getSimState().getMotorVoltage());
topSim.update(0.020);
topMotor.getSimState()
.setRotorVelocity(topSim.getAngularVelocityRPM() / 60.0);
topMotor.getSimState().addRotorPosition(topSim.getAngularVelocityRPM() / 60.0 * 0.020);
RoboRioSim.setVInVoltage(
BatterySim.calculateDefaultBatteryLoadedVoltage(topSim.getCurrentDrawAmps()));

bottomSim.setInput(bottomMotor.getSimState().getMotorVoltage());
bottomSim.update(0.020);
RoboRioSim.setVInVoltage(
BatterySim.calculateDefaultBatteryLoadedVoltage(bottomSim.getCurrentDrawAmps()));
bottomMotor.getSimState()
.setRotorVelocity(topSim.getAngularVelocityRPM() / 60.0);
bottomMotor.getSimState().addRotorPosition(topSim.getAngularVelocityRPM() / 60.0 * 0.020);

}

/** Replaces the request */
private void setTopRequest(ControlRequest request) {
this.topRequest = request;
}

/** Replaces the request */
private void setBottomRequest(ControlRequest request) {
this.bottomRequest = request;
}

/** Stops the shooter */
public Command stop() {
return runOnce(
() -> {
setTopRequest(new CoastOut());
setBottomRequest(new CoastOut());
}
).withName("Stopped");
}

public Command shoot(double topSpeed, double bottomSpeed) {
return runOnce(() -> {
setTopRequest(new VelocityVoltage(topSpeed));
setBottomRequest(new VelocityVoltage(bottomSpeed));
}).andThen(Commands.repeatingSequence(Commands.none())).withName("Shooting");
}

public Command shoot() {
return shoot(512, -512);
}

@Override
public void initSendable(SendableBuilder builder) {
super.initSendable(builder);

builder.addDoubleProperty(
"TopSpeed",
() -> lastReadSpeedTop,
null);
TelemetryManager.makeSendableTalonFX("Top", topMotor, builder);

builder.addDoubleProperty(
"BottomSpeed",
() -> lastReadSpeedBottom,
null);
TelemetryManager.makeSendableTalonFX("Bottom", bottomMotor, builder);
}
}
41 changes: 41 additions & 0 deletions src/main/java/frc/robot/subsystems/shooter/ShooterConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package frc.robot.subsystems.shooter;

import com.ctre.phoenix6.configs.CurrentLimitsConfigs;
import com.ctre.phoenix6.configs.Slot0Configs;
import com.ctre.phoenix6.configs.TalonFXConfiguration;
import com.ctre.phoenix6.configs.VoltageConfigs;

public final class ShooterConstants {
public static final double GEAR_RATIO = 1;

/** Motor ids */
public static enum Motors {
TOPLEFT(12),
BOTTOMLEFT(13),
TOPRIGHT(12),
BOTTOMRIGHT(13);
public final int id;
private Motors(int id) {
this.id = id;
}
}

/** Config for shooter motors */
public static TalonFXConfiguration getConfig() {
return new TalonFXConfiguration()
.withSlot0(new Slot0Configs()
.withKV(0.0)
.withKP(0.3 )
.withKI(0.001)
.withKD(0.0)
.withKA(0.1)
.withKS(0.1)
.withKV(0.1)) // placeholder values
.withCurrentLimits(new CurrentLimitsConfigs()
.withStatorCurrentLimit(60)
.withSupplyCurrentLimit(60))
.withVoltage(new VoltageConfigs()
.withPeakForwardVoltage(12.0)
.withPeakReverseVoltage(-12.0));
}
}
Loading