Class OrinGyroSourceIO
java.lang.Object
frc.robot.subsystems.vision.OrinGyroSourceIO
- All Implemented Interfaces:
PoseSourceIO
An Orin camera pose source that uses the robot's heading instead of solving for it. Built on the
camera's
OrinPoseSourceIO: it reads the results that source already logged and decoded,
so it logs nothing new and runs in replay too. Logged and shadowed, not fused, until replay says
it can be trusted. Only the newest usable result per loop is solved (CPU).
OrinGyroSourceIO.Mode.GYRO_PNP(issue #10, section 3): PhotonLib's constrained SolvePnP over every usable tag with the heading held to the robot's at the frame's timestamp, seeded from the fused pose; one tag falls back to PhotonLib's distance-trig solve. The robot-side answer to the Limelight's MegaTag2, without its "last pushed heading" latency.OrinGyroSourceIO.Mode.TXTY(section 8c, 6328'saddTxTyObservation): the closest tag's angles and solved distance, turned into a robot position with the robot's heading. The distance is reliable even when a single-tag pose is ambiguous; 6328 uses this for final alignment.
Both need the heading, so they report nothing until the pose is seeded.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich estimate this source makes. -
Field Summary
Fields inherited from interface PoseSourceIO
NONE -
Constructor Summary
ConstructorsConstructorDescriptionOrinGyroSourceIO(OrinGyroSourceIO.Mode mode, String cameraName, OrinPoseSourceIO camera, Transform3d robotToCamera, AprilTagFieldLayout layout, Supplier<Set<Integer>> excludedTags, DoubleFunction<Pose2d> fusedPoseAt) -
Method Summary
Modifier and TypeMethodDescriptionbooleanderived()Whether this IO computes its observations from inputs it logs itself, rather than reading a device.voidupdateInputs(PoseSourceInputs inputs) Fillsinputswith everything reported since the last call.
-
Constructor Details
-
OrinGyroSourceIO
public OrinGyroSourceIO(OrinGyroSourceIO.Mode mode, String cameraName, OrinPoseSourceIO camera, Transform3d robotToCamera, AprilTagFieldLayout layout, Supplier<Set<Integer>> excludedTags, DoubleFunction<Pose2d> fusedPoseAt) - Parameters:
mode- which estimatecameraName- PhotonVision camera name, for the log pathcamera- the camera's main source, which must update first each looprobotToCamera- camera mountlayout- the field's tagsexcludedTags- tags to leave outfusedPoseAt- the fused pose at a capture time, or null before the pose is seeded
-
-
Method Details
-
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
-
updateInputs
Description copied from interface:PoseSourceIOFillsinputswith everything reported since the last call.- Specified by:
updateInputsin interfacePoseSourceIO- Parameters:
inputs- the inputs to overwrite
-