Class PoseSourceInputs
- All Implemented Interfaces:
LoggableInputs
This is logged before any gate runs. It is the raw record that answers "would this source have been right?", and in replay it is what the gates and the fusion re-run against. The observations are stored as parallel arrays because AdvantageKit logs arrays of primitives and structs natively.
Size matters here: these inputs were a third of the log. AdvantageKit writes a value only when
it changes, and the observation arrays change every frame (a frame is reported once, then the
arrays go back to empty). So values that are the same for every observation of a source are not
arrays: Kind is one number per source, written once, and Tracking is written only
for a loop in which some observation was not tracking (AprilTag solves always are; the Quest
sometimes is not). Logs written before this change still replay: their per-observation
Kinds and full Tracking arrays are read when present.
Logged under /Localization/Sources/<name>/....
-
Field Summary
FieldsModifier and TypeFieldDescriptiondouble[]booleanWhether the device is talking at all (NT heartbeat, frames arriving).static final intdouble[]Per-tag data of this loop's frame,FIDUCIAL_STRIDEvalues per tag: id, horizontal and vertical angle from the principal point (deg, positive right and up), camera-to-tag distance (m), ambiguity.double[]Source-specific health numbers, e.g.intPoseObservation.Kindordinal of this source's observations; -1 before the first.double[]Pose3d[]double[]Per-observationPoseObservation.stdDevScale; logged only when some entry isn't 1.int[]int[]Every tag id seen this loop, for display.double[]double[]boolean[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcount()Number of observations.voidRebuilds observationi, e.g.voidrecordAsOutputs(String prefix) Records these observations as AdvantageKit outputs underprefix, for a source whose observations are computed from other logged inputs (seePoseSourceIO.derived()).voidresize(int n) Sets the observation arrays to holdnentries.voidset(int i, PoseObservation o) Writes observationi.void
-
Field Details
-
connected
public boolean connectedWhether the device is talking at all (NT heartbeat, frames arriving). -
timestamps
public double[] timestamps -
poses
-
kind
public int kindPoseObservation.Kindordinal of this source's observations; -1 before the first. -
tagCounts
public int[] tagCounts -
avgTagDistances
public double[] avgTagDistances -
targetSizes
public double[] targetSizes -
maxAmbiguities
public double[] maxAmbiguities -
tracking
public boolean[] tracking -
stdDevScales
public double[] stdDevScalesPer-observationPoseObservation.stdDevScale; logged only when some entry isn't 1. -
tagIds
public int[] tagIdsEvery tag id seen this loop, for display. -
fiducials
public double[] fiducialsPer-tag data of this loop's frame,FIDUCIAL_STRIDEvalues per tag: id, horizontal and vertical angle from the principal point (deg, positive right and up), camera-to-tag distance (m), ambiguity. Limelight MegaTag1 only; empty otherwise. -
FIDUCIAL_STRIDE
public static final int FIDUCIAL_STRIDE- See Also:
-
health
public double[] healthSource-specific health numbers, e.g. QuestNav battery, Limelight fps. Keys fixed per IO.
-
-
Constructor Details
-
PoseSourceInputs
public PoseSourceInputs()
-
-
Method Details
-
resize
public void resize(int n) Sets the observation arrays to holdnentries. -
set
Writes observationi. -
count
public int count()Number of observations. -
get
Rebuilds observationi, e.g. from replayed inputs. -
toLog
- Specified by:
toLogin interfaceLoggableInputs
-
fromLog
- Specified by:
fromLogin interfaceLoggableInputs
-
recordAsOutputs
Records these observations as AdvantageKit outputs underprefix, for a source whose observations are computed from other logged inputs (seePoseSourceIO.derived()). In replay they are recomputed, not read back.
-