Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"Bash(JAVA_HOME=\"/c/Users/Public/wpilib/2026/jdk\" ./gradlew compileJava:*)",
"Bash(set \"JAVA_HOME=C:\\\\Users\\\\Public\\\\wpilib\\\\2026\\\\jdk\")",
"Bash(\"C:\\\\Users\\\\Public\\\\wpilib\\\\2026\\\\jdk\\\\bin\\\\java\" -version)",
"Bash(git show:*)"
"Bash(git show:*)",
"Bash(set:*)"
]
}
}
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ private void configureBindings() {

// Right trigger: enter SHOOTING state. Superstructure coordinates flywheel spin-up,
// waits for adequate RPM, then runs spindexer and feeders. On release, returns to IDLE.
controlBoard
.getWantShoot()
.whileTrue(ShooterFactory.shootWithTrackingCommand(superstructure, turretManager));
controlBoard.getWantShoot().whileTrue(ShooterFactory.setShootingCommand(superstructure));

// Zone-based actions: automatically retract hood when entering trench zones
configureTrenchZoneTrigger();
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/frc/robot/controlboard/ControlBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ public double getRotation() {
return driveControlBoard.getRotation();
}

@Override
public double getRotationY() {
return driveControlBoard.getRotationY();
}

@Override
public Trigger resetGyro() {
return driveControlBoard.resetGyro();
Expand All @@ -50,11 +45,6 @@ public Trigger getWantToXWheels() {
return buttonControlBoard.getWantToXWheels();
}

@Override
public Trigger getWantToAutoAlign() {
return buttonControlBoard.getWantToAutoAlign();
}

@Override
public Trigger getWantHubPathFind() {
return driveControlBoard.getWantHubPathFind();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,4 @@ private GamepadButtonControlBoard() {
public Trigger getWantToXWheels() {
return controller.start().and(controller.back().negate());
}

@Override
public Trigger getWantToAutoAlign() {
return controller.start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ public double getRotation() {
* Math.signum(controller.getRightX());
}

@Override
public double getRotationY() {
return -(Math.pow(Math.abs(controller.getRightY()), 2.0))
* Math.signum(controller.getRightY());
}

@Override
public Trigger resetGyro() {
return controller.povRight().and(controller.start().negate());
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/controlboard/IButtonControlBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

public interface IButtonControlBoard {
Trigger getWantToXWheels();

Trigger getWantToAutoAlign();
}
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/controlboard/IDriveControlBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ public interface IDriveControlBoard {

double getRotation();

double getRotationY();

Trigger resetGyro();

Trigger getWantHubPathFind();
Expand Down
27 changes: 0 additions & 27 deletions src/main/java/frc/robot/factories/IntakeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,4 @@ public static Command setIntakingCommand(Superstructure superstructure) {
() -> superstructure.setGoal(Goal.IDLE))
.withName("setIntakingCommand");
}

/**
* Command to set the superstructure to OUTTAKING state. Runs continuously - use with
* whileTrue() bindings. Returns to IDLE when interrupted.
*
* @param superstructure The superstructure subsystem
* @return Command that maintains OUTTAKING state while running
*/
public static Command setOuttakingCommand(Superstructure superstructure) {
return superstructure
.startEnd(
() -> superstructure.setGoal(Goal.OUTTAKING),
() -> superstructure.setGoal(Goal.IDLE))
.withName("setOuttakingCommand");
}

/**
* Command to set the superstructure to IDLE state immediately.
*
* @param superstructure The superstructure subsystem
* @return Instant command that sets IDLE goal
*/
public static Command setIdleCommand(Superstructure superstructure) {
return superstructure
.runOnce(() -> superstructure.setGoal(Goal.IDLE))
.withName("setIdleCommand");
}
}
34 changes: 0 additions & 34 deletions src/main/java/frc/robot/factories/ShooterFactory.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package frc.robot.factories;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import frc.robot.subsystems.shooter.TurretManager;
import frc.robot.subsystems.superstructure.Superstructure;
import frc.robot.subsystems.superstructure.Superstructure.Goal;

Expand All @@ -28,36 +26,4 @@ public static Command setShootingCommand(Superstructure superstructure) {
() -> superstructure.setGoal(Goal.IDLE))
.withName("setShootingCommand");
}

/**
* Command to shoot while turrets track the hub. Returns to IDLE when interrupted.
*
* @param superstructure The superstructure subsystem
* @param turretManager The turret manager subsystem
* @return Command that shoots while tracking the hub
*/
public static Command shootWithTrackingCommand(
Superstructure superstructure, TurretManager turretManager) {
return superstructure
.startEnd(
() -> superstructure.setGoal(Goal.SHOOTING),
() -> superstructure.setGoal(Goal.IDLE))
.withName("shootWithTrackingCommand");
}

/**
* Command to wait for turrets to aim and then shoot. Waits until turrets are aligned before
* starting to shoot. Use for autonomous sequences where precise aiming is required.
*
* @param superstructure The superstructure subsystem
* @param turretManager The turret manager subsystem
* @return Command that waits for aim then shoots
*/
public static Command aimAndShootCommand(
Superstructure superstructure, TurretManager turretManager) {
return Commands.sequence(
Commands.waitUntil(turretManager::areBothAtTarget),
setShootingCommand(superstructure))
.withName("aimThenShootCommand");
}
}
84 changes: 0 additions & 84 deletions src/main/java/frc/robot/lib/commands/ChezyRepeatCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.ctre.phoenix6.hardware.CANcoder;
import edu.wpi.first.units.measure.Angle;
import edu.wpi.first.units.measure.AngularVelocity;
import frc.robot.lib.util.CANStatusLogger;
import frc.robot.lib.util.CTREUtil;

public class CanCoderIOHardware implements CanCoderIO {
Expand All @@ -32,13 +31,6 @@ public CanCoderIOHardware(CanCoderConfig config) {
signals = new BaseStatusSignal[] {positionSignal, velocitySignal};

BaseStatusSignal.setUpdateFrequencyForAll(100.0, signals);

CANStatusLogger.getInstance()
.registerCANcoder(
"CANcoder_ID" + config.CANID.getDeviceNumber(),
canCoder,
config.CANID.getDeviceNumber(),
config.CANID.getBus());
}

@Override
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/frc/robot/lib/util/CANBusStatusLogger.java

This file was deleted.

80 changes: 1 addition & 79 deletions src/main/java/frc/robot/lib/util/CANStatusLogger.java
Original file line number Diff line number Diff line change
@@ -1,39 +1,10 @@
package frc.robot.lib.util;

import com.ctre.phoenix6.BaseStatusSignal;
import com.ctre.phoenix6.StatusCode;
import com.ctre.phoenix6.StatusSignal;
import com.ctre.phoenix6.hardware.CANcoder;
import com.ctre.phoenix6.hardware.TalonFX;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import frc.robot.lib.drivers.CANDeviceId;
import java.util.ArrayList;
import java.util.List;
import org.littletonrobotics.junction.Logger;

public class CANStatusLogger {
private static CANStatusLogger instance;
private final List<DeviceStatusInfo> devices = new ArrayList<>();

private static class DeviceStatusInfo {
private final String name;
private final TalonFX talon;
private final int deviceId;
private final String canBus;
private final StatusSignal<?> supplyVoltage;

public DeviceStatusInfo(String name, TalonFX talon, int deviceId, String canBus) {
this.name = name;
this.talon = talon;
this.deviceId = deviceId;
this.canBus = canBus;
this.supplyVoltage = talon.getSupplyVoltage();

if (this.supplyVoltage != null) {
this.supplyVoltage.setUpdateFrequency(100);
}
}
}

private CANStatusLogger() {}

Expand All @@ -45,59 +16,10 @@ public static synchronized CANStatusLogger getInstance() {
}

public void registerTalonFX(String name, TalonFX talon, int deviceId, String canBus) {
devices.add(new DeviceStatusInfo(name, talon, deviceId, canBus));
// Registration placeholder for future CAN status monitoring
}

public void registerTalonFX(String name, TalonFX talon, CANDeviceId deviceId) {
registerTalonFX(name, talon, deviceId.getDeviceNumber(), deviceId.getBus());
}

public void registerCANcoder(String name, CANcoder cancoder, int deviceId, String canBus) {
// This method is kept for compatibility but doesn't need to track CANcoders
}

private BaseStatusSignal[] signals;

private void initializeSignalArray() {
int validSignalCount = 0;
for (DeviceStatusInfo device : devices) {
if (device.supplyVoltage != null) {
validSignalCount++;
}
}

if (signals == null || signals.length != validSignalCount) {
signals = new BaseStatusSignal[validSignalCount];
int index = 0;
for (DeviceStatusInfo device : devices) {
if (device.supplyVoltage != null) {
signals[index++] = device.supplyVoltage;
}
}
}
}

public void updateCanStatus() {
if (signals == null) {
initializeSignalArray();
}
try {
BaseStatusSignal.refreshAll(signals);
} catch (Exception e) {
}

// Check each device status
for (int i = 0; i < devices.size(); i++) {
DeviceStatusInfo device = devices.get(i);
String deviceName = device.name + "ID" + device.deviceId;
boolean isConnected = false;

if (device.talon != null && device.supplyVoltage != null) {
isConnected = (device.supplyVoltage.getStatus() == StatusCode.OK);
}

Logger.recordOutput("CANstatus/" + deviceName, isConnected);
SmartDashboard.putBoolean("CAN/" + device.canBus + "/" + deviceName, isConnected);
}
}
}
Loading