Skip to content

Commit

Permalink
made acceptable window for ferry x.
Browse files Browse the repository at this point in the history
Co-authored-by: k4limul <[email protected]>
  • Loading branch information
IanShiii and k4limul committed Jun 18, 2024
1 parent a42e5bb commit 0fa4a86
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.stuypulse.robot.Robot;
import com.stuypulse.robot.constants.Field;
import com.stuypulse.robot.subsystems.odometry.Odometry;
import com.stuypulse.stuylib.math.SLMath;

import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
Expand All @@ -32,7 +33,7 @@ public SwerveDriveToFerry() {
// use robot's y, put in x and rotation

return new Pose2d(
Field.CONST_FERRY_X,
SLMath.clamp(robot.getX(), Field.FERRY_SHOT_MIN_X, Field.FERRY_SHOT_MAX_X),
Robot.isBlue() ? Math.max(robot.getY(), Field.FERRY_CUTOFF) : Math.min(robot.getY(), Field.WIDTH - Field.FERRY_CUTOFF),
targetAngle
);
Expand Down

0 comments on commit 0fa4a86

Please sign in to comment.