Skip to content

Commit 95236e5

Browse files
authored
[docs] Fix usage of getTagPose (#1442)
1 parent 30e930f commit 95236e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/source/docs/programming/photonlib/using-target-data.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ A `PhotonUtils` class with helpful common calculations is included within `Photo
1111
.. code-block:: Java
1212
1313
// Calculate robot's field relative pose
14-
Pose3d robotPose = PhotonUtils.estimateFieldToRobotAprilTag(target.getBestCameraToTarget(), aprilTagFieldLayout.getTagPose(target.getFiducialId()), cameraToRobot);
14+
if (aprilTagFieldLayout.getTagPose(target.getFiducialId()).isPresent()) {
15+
Pose3d robotPose = PhotonUtils.estimateFieldToRobotAprilTag(target.getBestCameraToTarget(), aprilTagFieldLayout.getTagPose(target.getFiducialId()).get(), cameraToRobot);
16+
}
1517
.. code-block:: C++
1618
1719
//TODO

0 commit comments

Comments
 (0)