Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Update robot-pose-estimator.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
LJWsao authored Jan 15, 2024
1 parent 496f77e commit 7b1da48
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/docs/programming/photonlib/robot-pose-estimator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ Calling ``update()`` on your ``PhotonPoseEstimator`` will return an ``EstimatedR
}

You should be updating your `drivetrain pose estimator <https://docs.wpilib.org/en/latest/docs/software/advanced-controls/state-space/state-space-pose-estimators.html>`_ 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
------------------------------------------
Expand Down

0 comments on commit 7b1da48

Please sign in to comment.