[photon-lib] Add PhotonPoseEstimator.resetHeadingData() (#1933)

This commit is contained in:
Bryce Roethel
2025-04-26 00:57:27 -04:00
committed by GitHub
parent 99b4dc8725
commit c1b0c8a831

View File

@@ -336,6 +336,19 @@ public class PhotonPoseEstimator {
headingBuffer.addSample(timestampSeconds, heading);
}
/**
* Clears all heading data in the buffer, and adds a new seed. Useful for preventing estimates
* from utilizing heading data provided prior to a pose or rotation reset.
*
* @param timestampSeconds timestamp of the robot heading data.
* @param heading Field-relative robot heading at given timestamp. Standard WPILIB field
* coordinates.
*/
public void resetHeadingData(double timestampSeconds, Rotation2d heading) {
headingBuffer.clear();
addHeadingData(timestampSeconds, heading);
}
/**
* @return The current transform from the center of the robot to the camera mount position
*/