From 7b1da48094d3201741b85f45d4f150316c5ea7ba Mon Sep 17 00:00:00 2001 From: LJWsao <112007778+LJWsao@users.noreply.github.com> Date: Mon, 15 Jan 2024 18:54:27 +0000 Subject: [PATCH] Update robot-pose-estimator.rst --- .../docs/programming/photonlib/robot-pose-estimator.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/docs/programming/photonlib/robot-pose-estimator.rst b/source/docs/programming/photonlib/robot-pose-estimator.rst index 2f30c3d4..02088528 100644 --- a/source/docs/programming/photonlib/robot-pose-estimator.rst +++ b/source/docs/programming/photonlib/robot-pose-estimator.rst @@ -104,6 +104,15 @@ Calling ``update()`` on your ``PhotonPoseEstimator`` will return an ``EstimatedR } You should be updating your `drivetrain pose estimator `_ with the result from the ``RobotPoseEstimator`` every loop using ``addVisionMeasurement()``. TODO: add example note +.. tab-set-code:: + .. code-block:: java + var result = photonCam_1.getLatestResult(); + if (result.hasTargets()) { //Make + var update = photonPoseEstimator.update(); + Pose3d currentPose3d = update.get().estimatedPose; + botPose = currentPose3d.toPose2d(); + photonTimestamp = update.get().timestampSeconds; + } Additional ``PhotonPoseEstimator`` Methods ------------------------------------------