Class OrinPoseSourceIO

java.lang.Object
frc.robot.subsystems.vision.OrinPoseSourceIO
All Implemented Interfaces:
PoseSourceIO

public class OrinPoseSourceIO extends Object implements PoseSourceIO
The Orin camera's pose source: reads the camera into logged OrinCameraInputs, then solves poses from those inputs with OrinSolver. It is derived: in replay the camera IO is OrinCameraIO.NONE, the raw inputs come back from the log, and the solve runs again, so mounts, the solver and its filters can all be changed and re-run against a match.
  • Constructor Details

    • OrinPoseSourceIO

      public OrinPoseSourceIO(String cameraName, OrinCameraIO io, OrinSolver solver, Supplier<Set<Integer>> excludedTags, DoubleFunction<Rotation2d> headingAt)
      Parameters:
      cameraName - PhotonVision camera name; also the log path
      io - the camera (OrinCameraIO.NONE in replay)
      solver - this camera's solver
      excludedTags - tags to leave out of single-tag solves (section 12)
      headingAt - robot heading at a capture time, or null if not known yet
  • Method Details

    • getLastResultTimestampSeconds

      public double getLastResultTimestampSeconds()
      Capture time of the newest result, PhotonLib's timebase; NaN before the first.
    • derived

      public boolean derived()
      Description copied from interface: PoseSourceIO
      Whether this IO computes its observations from inputs it logs itself, rather than reading a device. A derived IO runs in replay too (over its own replayed inputs), so PoseSource records its observations as outputs instead of restoring them from the log.
      Specified by:
      derived in interface PoseSourceIO
    • setPipelineIndex

      public void setPipelineIndex(int index)
      Asks the camera to run a pipeline. Ignored in replay.
    • updateInputs

      public void updateInputs(PoseSourceInputs inputs)
      Description copied from interface: PoseSourceIO
      Fills inputs with everything reported since the last call.
      Specified by:
      updateInputs in interface PoseSourceIO
      Parameters:
      inputs - the inputs to overwrite
    • getCameraInputs

      public OrinCameraInputs getCameraInputs()
    • getSolver

      public OrinSolver getSolver()
    • getResultsPerSecond

      public double getResultsPerSecond()
      Results per second over the last full second (section 7a); NaN until the first second.
    • getLastResultSeconds

      public double getLastResultSeconds()
      When the camera last sent a result; NaN before the first. Robot clock, replayed.