Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,13 @@ public class MultiPhotonPoseEstimator implements AutoCloseable {
private PhotonPoseEstimator.PoseStrategy poseEstimatorStrategy;

/** A builder for {@code MultiPhotonPoseEstimator}. */
public static class Builder {
public static final class Builder {
private final Map<String, CameraConfig> cameraConfigs = new HashMap<>();
private final AprilTagFieldLayout aprilTagFieldLayout;
private final NetworkTableInstance ntInstance;
private final PhotonPoseEstimator.PoseStrategy poseEstimatorStrategy;

/**
* {@code MultiPhotonPoseEstimator} builder constructor.
*
* @param ntInstance Network table instance used to log the pose of AprilTag detections as well
* as pose estimates.
* @param aprilTagFieldLayout WPILib field description (dimensions) including AprilTag 3D
* locations.
* @param poseEstimatorStrategy Posing strategy (for instance, multi tag PnP, closest to camera
* tag, etc.)
*/
public Builder(
Builder(
NetworkTableInstance ntInstance,
AprilTagFieldLayout aprilTagFieldLayout,
PhotonPoseEstimator.PoseStrategy poseEstimatorStrategy) {
Expand Down Expand Up @@ -142,6 +132,23 @@ public MultiPhotonPoseEstimator build() {
}
}

/**
* Creates a builder for building {@link MultiPhotonPoseEstimator} instances.
*
* @param ntInstance Network table instance used to log the pose of AprilTag detections as well as
* pose estimates.
* @param aprilTagFieldLayout WPILib field description (dimensions) including AprilTag 3D
* locations.
* @param poseEstimatorStrategy Posing strategy (for instance, multi tag PnP, closest to camera
* tag, etc.)
*/
public static Builder builder(
NetworkTableInstance ntInstance,
AprilTagFieldLayout aprilTagFieldLayout,
PhotonPoseEstimator.PoseStrategy poseEstimatorStrategy) {
return new Builder(ntInstance, aprilTagFieldLayout, poseEstimatorStrategy);
}

/**
* Adds all cameras to a simulated vision system.
*
Expand Down