diff --git a/utilities/flippable/FlippablePose2d.java b/utilities/flippable/FlippablePose2d.java index 7c6f467d..9bff1a39 100644 --- a/utilities/flippable/FlippablePose2d.java +++ b/utilities/flippable/FlippablePose2d.java @@ -51,6 +51,15 @@ public FlippableRotation2d getRotation() { return new FlippableRotation2d(nonFlippedObject.getRotation(), shouldFlipWhenRedAlliance); } + /** + * Gets the translation value of the pose. The pose will be flipped if the robot is on the red alliance and {@link #shouldFlipWhenRedAlliance} is true. + * + * @return the translation value of the pose + */ + public FlippableTranslation2d getTranslation() { + return new FlippableTranslation2d(nonFlippedObject.getTranslation(), shouldFlipWhenRedAlliance); + } + @Override protected Pose2d flip(Pose2d pose) { return FlippingUtil.flipFieldPose(pose);