Class OrinPoseSourceIO
java.lang.Object
frc.robot.subsystems.vision.OrinPoseSourceIO
- All Implemented Interfaces:
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.-
Field Summary
Fields inherited from interface PoseSourceIO
NONE -
Constructor Summary
ConstructorsConstructorDescriptionOrinPoseSourceIO(String cameraName, OrinCameraIO io, OrinSolver solver, Supplier<Set<Integer>> excludedTags, DoubleFunction<Rotation2d> headingAt) -
Method Summary
Modifier and TypeMethodDescriptionbooleanderived()Whether this IO computes its observations from inputs it logs itself, rather than reading a device.doubleWhen the camera last sent a result; NaN before the first.doubleCapture time of the newest result, PhotonLib's timebase; NaN before the first.doubleResults per second over the last full second (section 7a); NaN until the first second.voidsetPipelineIndex(int index) Asks the camera to run a pipeline.voidupdateInputs(PoseSourceInputs inputs) Fillsinputswith everything reported since the last call.
-
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 pathio- the camera (OrinCameraIO.NONEin replay)solver- this camera's solverexcludedTags- 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:PoseSourceIOWhether 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), soPoseSourcerecords its observations as outputs instead of restoring them from the log.- Specified by:
derivedin interfacePoseSourceIO
-
setPipelineIndex
public void setPipelineIndex(int index) Asks the camera to run a pipeline. Ignored in replay. -
updateInputs
Description copied from interface:PoseSourceIOFillsinputswith everything reported since the last call.- Specified by:
updateInputsin interfacePoseSourceIO- Parameters:
inputs- the inputs to overwrite
-
getCameraInputs
-
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.
-