Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
chore: Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenheroux committed Apr 2, 2024
1 parent d2fdf81 commit 2dd37bb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/arm/Arm.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/arm/ArmConstants.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package frc.robot.arm;

/** Constants for the arm subsystem. */
public class ArmConstants {}
public class ArmConstants {}
7 changes: 4 additions & 3 deletions src/main/java/frc/robot/arm/ShoulderMotorIOTalonFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/intake/RollerMotorIOTalonFX.java
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2dd37bb

Please sign in to comment.