Skip to content

Commit

Permalink
Merged code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth-Choothakan committed Feb 3, 2024
1 parent 3c19b6a commit 47e0138
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Arm extends SubsystemBase {
//there is only one arm motor.
private final SimpleMotorFeedforward armFeed = new SimpleMotorFeedforward(Constants.Arm.kS, Constants.Arm.kV);
private final SparkAbsoluteEncoder armEncoder = armMotor1.getAbsoluteEncoder(SparkAbsoluteEncoder.Type.kDutyCycle);
private final PIDController armPID = new PIDController(Constants.Arm.kP[0], Constants.Arm.kI[0], Constants.Arm.kD[0]);
private final PIDController armPID = new PIDController(Constants.Arm.kP, Constants.Arm.kI, Constants.Arm.kD);
public Arm() {
//arm
/*
Expand Down Expand Up @@ -90,8 +90,9 @@ public void driveArm(TrapezoidProfile.State state) {
}
double volts = armFeedVolts + armPIDVolts;
armMotor1.setVoltage(volts);
}
*/
}
public double getArmClampedGoal(double goal) {
//Find the limits of the arm. Used to move it and ensure that the arm does not move past the amount
return MathUtil.clamp(MathUtil.inputModulus(goal, Constants.Arm.ARM_DICONT_RAD, Constants.Arm.ARM_DICONT_RAD + 2 * Math.PI), Constants.Arm.LOWER_ANGLE_LIMIT, Constants.Arm.UPPER_ANGLE_LIMIT);
Expand Down

0 comments on commit 47e0138

Please sign in to comment.