Skip to content

Commit

Permalink
Check for setpoint and goal equal in arm
Browse files Browse the repository at this point in the history
  • Loading branch information
suryatho committed Feb 16, 2024
1 parent 4bca0b1 commit 21b8554
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.littletonrobotics.frc2024.RobotState;
import org.littletonrobotics.frc2024.util.EqualsUtil;
import org.littletonrobotics.frc2024.util.LoggedTunableNumber;
import org.littletonrobotics.junction.AutoLogOutput;
import org.littletonrobotics.junction.Logger;
Expand Down Expand Up @@ -158,8 +159,7 @@ public Rotation2d getSetpoint() {

@AutoLogOutput(key = "Arm/AtGoal")
public boolean atGoal() {
return Math.abs(setpointState.position - goal.getRads())
<= Units.degreesToRadians(toleranceDegrees.get());
return EqualsUtil.epsilonEquals(setpointState.position, goal.getRads(), 1e-3);
}

// public Command getStaticCurrent() {
Expand Down

0 comments on commit 21b8554

Please sign in to comment.