diff --git a/lib/src/main/java/org/fairportrobotics/frc/robolib/trajectory/ballistics/constraints/BCEvalParams.java b/lib/src/main/java/org/fairportrobotics/frc/robolib/trajectory/ballistics/constraints/BCEvalParams.java index 6870feb..be3ec9b 100644 --- a/lib/src/main/java/org/fairportrobotics/frc/robolib/trajectory/ballistics/constraints/BCEvalParams.java +++ b/lib/src/main/java/org/fairportrobotics/frc/robolib/trajectory/ballistics/constraints/BCEvalParams.java @@ -2,6 +2,7 @@ package org.fairportrobotics.frc.robolib.trajectory.ballistics.constraints; import org.fairportrobotics.frc.robolib.trajectory.Velocity3d; +import edu.wpi.first.units.Units; import edu.wpi.first.units.measure.Angle; /** @@ -25,8 +26,8 @@ public class BCEvalParams { private Velocity3d cache_candidateShooterVelocityRelative; // - // Setup - //) + // Setup + // public BCEvalParams( Velocity3d robotVelocity, @@ -109,6 +110,23 @@ public class BCEvalParams { return this.cache_candidateShooterVelocityRelative; } + public int hashCode() { + return this.robotVelocity.hashCode() ^ + Double.hashCode(this.robotAngle.in(Units.Degrees)) ^ + this.currentShooterVelocity.hashCode() ^ + this.candidateVelocity.hashCode(); + } + + public String toString() { + return String.format( + "BCEvalParams(robotVelocity: %s, robotAngle: %s, currentShooterVelocity: %s, candidateVelocity: %s)", + this.robotVelocity.toString(), + this.robotAngle.toString(), + this.currentShooterVelocity.toString(), + this.candidateVelocity.toString() + ); + } + public boolean equals(BCEvalParams other) { return this.robotVelocity.equals(other.getRobotVelocity()) &&