Skip to content

Commit

Permalink
PID
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedHearth committed Feb 19, 2024
1 parent 8f687dc commit 8e6f6b3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/main/java/frc/robot/subsystems/arm/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public Arm(ArmIO io) {
// separate robot with different tuning)
switch (EnvironmentalConstants.currentMode) {
case REAL:
io.configurePID(ArmConstants.kP, ArmConstants.kI, ArmConstants.kD);
case REPLAY:
ffModel = new SimpleMotorFeedforward(ArmConstants.ks, ArmConstants.kv);
io.configurePID(ArmConstants.kP, ArmConstants.kI, ArmConstants.kD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public ArmElevator(ArmElevatorIO io) {
// separate robot with different tuning)
switch (EnvironmentalConstants.currentMode) {
case REAL:
io.configurePID(ArmElevatorConstants.kP, ArmElevatorConstants.kI, ArmElevatorConstants.kD);
case REPLAY:
ffModel = new SimpleMotorFeedforward(ArmElevatorConstants.ks, ArmElevatorConstants.kv);
io.configurePID(ArmElevatorConstants.kP, ArmElevatorConstants.kI, ArmElevatorConstants.kD);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/subsystems/flywheel/Flywheel.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public Flywheel(FlywheelIO io) {
// Switch constants based on mode.
switch (EnvironmentalConstants.currentMode) {
case REAL:
io.configurePID(FlywheelConstants.kP, FlywheelConstants.kI, FlywheelConstants.kD);
case REPLAY:
ffModel = new SimpleMotorFeedforward(FlywheelConstants.ks, FlywheelConstants.kv);
io.configurePID(FlywheelConstants.kP, FlywheelConstants.kI, FlywheelConstants.kD);
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/subsystems/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ public class Intake extends SubsystemBase {
public Intake(IntakeIO io) {
this.io = io;

// Switch constants based on mode (the physics simulator is treated as a
// separate robot with different tuning)

io.configurePID(
Constants.IntakeConstants.kP, Constants.IntakeConstants.kI, Constants.IntakeConstants.kD);

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/subsystems/wrist/Wrist.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ public class Wrist extends SubsystemBase {
public Wrist(WristIO io) {
this.io = io;

// Switch constants based on mode (the physics simulator is treated as a
// separate robot with different tuning)
switch (EnvironmentalConstants.currentMode) {
case REAL:
io.configurePID(WristConstants.kP, WristConstants.kI, WristConstants.kD);
case REPLAY:
ffModel = new SimpleMotorFeedforward(WristConstants.ks, WristConstants.kv);
io.configurePID(WristConstants.kP, WristConstants.kI, WristConstants.kD);
Expand Down

0 comments on commit 8e6f6b3

Please sign in to comment.