findClosestTag

fun Pose2d.findClosestTag(fieldLayout: AprilTagFieldLayout): Pair<Int, Distance>?

Finds the closest AprilTag to the robot's current pose.

Receiver

Pose2d The robot's current pose.

Return

Pair of tag ID and distance, or null if no tags exist.

Parameters

fieldLayout

The field layout containing tag positions.