Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PGgit08 committed Jan 28, 2024
1 parent 6bfdfad commit 7127765
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public static class PID {
public static final double SHOOTER_FLYWHEEL_KP = 0;

public static final double ELEVATOR_KP = 0;

public static final double SWERVE_HEADING_KP = 0.045;
public static final double SWERVE_HEADING_KD = 0.001;
}

public static class Offsets {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/commands/elevator/HoldElevator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

public class HoldElevator extends Command {
private final ElevatorSubsystem _elevator;
private final double _maintainHeight;

/** Creates a new HoldElevator. */
public HoldElevator(ElevatorSubsystem elevator) {
// Use addRequirements() here to declare subsystem dependencies.
addRequirements(elevator);
_elevator = elevator;
_maintainHeight = elevator.getElevatorHeight();
}

// Called when the command is initially scheduled.
Expand All @@ -25,7 +23,7 @@ public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
_elevator.setElevatorHeight(_maintainHeight); // holds the elevator in place
_elevator.setElevatorHeight(0); // holds the elevator in place at the bottom
}

// Called once the command ends or is interrupted.
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/commands/shooter/AutoAim.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
Expand All @@ -25,9 +24,9 @@ public class AutoAim extends Command {
private DoubleSupplier _ySpeed;

private PIDController _headingController = new PIDController(
0.045,
Constants.PID.SWERVE_HEADING_KP,
0,
0.001
Constants.PID.SWERVE_HEADING_KD
);

/** Creates a new AutoAim. */
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/frc/robot/commands/shooter/HoldShooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@

public class HoldShooter extends Command {
private final ShooterSubsystem _shooter;
private final double _maintainAngle;

/** Creates a new HoldShooter. */
public HoldShooter(ShooterSubsystem shooter) {
// Use addRequirements() here to declare subsystem dependencies.

_shooter = shooter;
_maintainAngle = shooter.getAngle();

addRequirements(shooter);
}

Expand All @@ -27,7 +23,7 @@ public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
_shooter.setAngle(_maintainAngle);
_shooter.setAngle(0);
}

// Called once the command ends or is interrupted.
Expand Down

0 comments on commit 7127765

Please sign in to comment.