Skip to content

(Low priority) Handle separate cameras better #94

@KangarooKoala

Description

@KangarooKoala

Instead of manually duplicating logic for each camera inside VisionSubsystem, we can make a helper class to handle everything that's specific to a camera and make two instances of that.

For example, inside VisionSubsystem, define this:

private class Camera {
  private final PhotonCamera photonCamera;
  private final PhotonPoseEstimator photonPoseEstimator;
  private final StructPublisher<Pose3d> rawFieldPose3dEntry;

  public Camera(String photonVisionName, String name, Transform3d robotToCamera) {
    // Initialize stuff here...
  }

  public void update() {
    // Loop over updates here
  }

  private void process(PhotonPipelineResult result) {
    // Process result here... Use the estimator and entry in the Camera class
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Vision SubsystemIssue involving the vision SubsystemenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions