mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Add ability query camera results outside of PhotonPoseEstimator (#786)
This commit is contained in:
@@ -212,6 +212,19 @@ public class PhotonPoseEstimator {
|
||||
}
|
||||
|
||||
PhotonPipelineResult cameraResult = camera.getLatestResult();
|
||||
|
||||
return update(cameraResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the estimated position of the robot. Returns empty if there are no cameras set or no
|
||||
* targets were found from the cameras.
|
||||
*
|
||||
* @param cameraResult The latest pipeline result from the camera
|
||||
* @return an EstimatedRobotPose with an estimated pose, and information about the camera(s) and
|
||||
* pipeline results used to create the estimate
|
||||
*/
|
||||
public Optional<EstimatedRobotPose> update(PhotonPipelineResult cameraResult) {
|
||||
if (!cameraResult.hasTargets()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user