Skip to content

Commit

Permalink
zylan's zilly zoofy zanges
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin212 authored and MysticalApple committed Apr 5, 2024
1 parent 52ce7f0 commit 1ace1e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public boolean atSpeed() {
* @return The splined top motor speed.
*/
public double getTopMotorSplineSpeed() {
return topFlywheelSpline.value(getShootingDistance());
return topFlywheelSpline.value(MathUtil.clamp(getShootingDistance(), ShooterConstants.MIN_SHOOTER_DISTANCE, ShooterConstants.MAX_SHOOTER_DISTANCE));
}

/**
Expand All @@ -186,7 +186,7 @@ public double getTopMotorSplineSpeed() {
* @return The spline bottom motor speed.
*/
public double getBottomMotorSplineSpeed() {
return bottomFlywheelSpline.value(getShootingDistance());
return bottomFlywheelSpline.value(MathUtil.clamp(getShootingDistance(), ShooterConstants.MIN_SHOOTER_DISTANCE, ShooterConstants.MAX_SHOOTER_DISTANCE));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public double getAutoAimAngle() {
// + " Set angle: " + GRTUtil.twoDecimals(Units.radiansToDegrees(angleSpline.value(currentDistance)))
// + " Current angle: " + GRTUtil.twoDecimals(Units.radiansToDegrees(rotationEncoder.getPosition())));

return angleSpline.value(getShootingDistance());
return angleSpline.value(MathUtil.clamp(getShootingDistance(), ShooterConstants.MIN_SHOOTER_DISTANCE, ShooterConstants.MAX_SHOOTER_DISTANCE));
}

/** Gets position of encoder. */
Expand Down

0 comments on commit 1ace1e2

Please sign in to comment.