Docs corrections related to PhotonPoseEstimator (#804)

This commit is contained in:
Andrew Gasser
2023-02-14 12:49:08 -06:00
committed by GitHub
parent 545e016d04
commit bf4a4db874
3 changed files with 8 additions and 11 deletions

View File

@@ -181,9 +181,6 @@ public class Drivetrain {
m_poseEstimator.update(
m_gyro.getRotation2d(), m_leftEncoder.getDistance(), m_rightEncoder.getDistance());
// Also apply vision measurements. We use 0.3 seconds in the past as an example
// -- on
// a real robot, this must be calculated based either on latency or timestamps.
Optional<EstimatedRobotPose> result =
pcw.getEstimatedGlobalPose(m_poseEstimator.getEstimatedPosition());

View File

@@ -79,8 +79,8 @@ public class PhotonCameraWrapper {
/**
* @param estimatedRobotPose The current best guess at robot pose
* @return A pair of the fused camera observations to a single Pose2d on the field, and the time
* of the observation. Assumes a planar field and the robot is always firmly on the ground
* @return an EstimatedRobotPose with an estimated pose, the timestamp, and targets used to create
* the estimate
*/
public Optional<EstimatedRobotPose> getEstimatedGlobalPose(Pose2d prevEstimatedRobotPose) {
photonPoseEstimator.setReferencePose(prevEstimatedRobotPose);