From 2dd37bb906c44c849c2972d38351a6b9fb8f03ce Mon Sep 17 00:00:00 2001 From: Hayden Heroux Date: Tue, 2 Apr 2024 17:00:22 -0400 Subject: [PATCH] chore: Format. --- src/main/java/frc/robot/arm/Arm.java | 3 +-- src/main/java/frc/robot/arm/ArmConstants.java | 2 +- src/main/java/frc/robot/arm/ShoulderMotorIOTalonFX.java | 7 ++++--- src/main/java/frc/robot/intake/RollerMotorIOTalonFX.java | 3 +-- .../frc/robot/superstructure/SuperstructureMechanism.java | 6 +----- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/frc/robot/arm/Arm.java b/src/main/java/frc/robot/arm/Arm.java index ec14ef5..2b6f295 100644 --- a/src/main/java/frc/robot/arm/Arm.java +++ b/src/main/java/frc/robot/arm/Arm.java @@ -1,7 +1,5 @@ package frc.robot.arm; -import java.util.function.DoubleSupplier; - import edu.wpi.first.math.trajectory.TrapezoidProfile; import edu.wpi.first.math.trajectory.TrapezoidProfile.State; import edu.wpi.first.math.util.Units; @@ -12,6 +10,7 @@ import frc.lib.Subsystem; import frc.lib.Telemetry; import frc.robot.arm.ShoulderMotorIO.ShoulderMotorIOValues; +import java.util.function.DoubleSupplier; /** Subsystem class for the arm subsystem. */ public class Arm extends Subsystem { diff --git a/src/main/java/frc/robot/arm/ArmConstants.java b/src/main/java/frc/robot/arm/ArmConstants.java index ade0089..d8c7f14 100644 --- a/src/main/java/frc/robot/arm/ArmConstants.java +++ b/src/main/java/frc/robot/arm/ArmConstants.java @@ -1,4 +1,4 @@ package frc.robot.arm; /** Constants for the arm subsystem. */ -public class ArmConstants {} \ No newline at end of file +public class ArmConstants {} diff --git a/src/main/java/frc/robot/arm/ShoulderMotorIOTalonFX.java b/src/main/java/frc/robot/arm/ShoulderMotorIOTalonFX.java index d2b94f0..a87429b 100644 --- a/src/main/java/frc/robot/arm/ShoulderMotorIOTalonFX.java +++ b/src/main/java/frc/robot/arm/ShoulderMotorIOTalonFX.java @@ -4,7 +4,6 @@ import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.signals.InvertedValue; import com.ctre.phoenix6.signals.NeutralModeValue; - import edu.wpi.first.math.controller.ArmFeedforward; import edu.wpi.first.math.controller.PIDController; import edu.wpi.first.math.util.Units; @@ -50,7 +49,8 @@ public void configure() { public void update(ShoulderMotorIOValues values) { values.positionRotations = getAbsolutePositionRotations(); values.velocityRotationsPerSecond = westTalonFX.getVelocity().refresh().getValue(); - values.accelerationRotationsPerSecondPerSecond = westTalonFX.getAcceleration().refresh().getValue(); + values.accelerationRotationsPerSecondPerSecond = + westTalonFX.getAcceleration().refresh().getValue(); values.currentAmps = westTalonFX.getStatorCurrent().refresh().getValue(); values.inputVoltage = westTalonFX.getMotorVoltage().refresh().getValue(); @@ -69,7 +69,8 @@ public void setSetpoint(double positionRotations, double velocityRotationsPerSec double feedbackVolts = feedback.calculate(measuredPositionRotations, positionRotations); double feedforwardVolts = - feedforward.calculate(Units.rotationsToRadians(measuredPositionRotations), velocityRotationsPerSecond); + feedforward.calculate( + Units.rotationsToRadians(measuredPositionRotations), velocityRotationsPerSecond); setVoltage(feedbackVolts + feedforwardVolts); } diff --git a/src/main/java/frc/robot/intake/RollerMotorIOTalonFX.java b/src/main/java/frc/robot/intake/RollerMotorIOTalonFX.java index 2d94863..6644005 100644 --- a/src/main/java/frc/robot/intake/RollerMotorIOTalonFX.java +++ b/src/main/java/frc/robot/intake/RollerMotorIOTalonFX.java @@ -1,16 +1,15 @@ package frc.robot.intake; -import edu.wpi.first.math.controller.SimpleMotorFeedforward; import com.ctre.phoenix6.configs.TalonFXConfiguration; import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.signals.NeutralModeValue; +import edu.wpi.first.math.controller.SimpleMotorFeedforward; import frc.lib.Configurator; /** Roller motor using a TalonFX. */ public class RollerMotorIOTalonFX implements RollerMotorIO { private final TalonFX topTalonFX, bottomTalonFX; - private final SimpleMotorFeedforward topFeedforward, bottomFeedforward; public RollerMotorIOTalonFX() { diff --git a/src/main/java/frc/robot/superstructure/SuperstructureMechanism.java b/src/main/java/frc/robot/superstructure/SuperstructureMechanism.java index ee8cf3b..c813511 100644 --- a/src/main/java/frc/robot/superstructure/SuperstructureMechanism.java +++ b/src/main/java/frc/robot/superstructure/SuperstructureMechanism.java @@ -78,11 +78,7 @@ private SuperstructureMechanism() { shoulder = shoulderBase.append( new MechanismLigament2d( - "shoulder", - Units.inchesToMeters(16.775), - 0, - armThickness, - DEFAULT_COLOR)); + "shoulder", Units.inchesToMeters(16.775), 0, armThickness, DEFAULT_COLOR)); flywheel = shoulder.append(