Class Jetson

java.lang.Object
frc.robot.subsystems.vision.Jetson

public class Jetson extends Object
The Jetson Orin as a whole: what the robot tells it, and what the robot checks about it before a match. Issue #10, sections 4, 6, 7, 8a, 8f, 9, 11 and 12.
  • Rewind (8a): with the FMS attached, records from enable until 10 s after the last disable, so a match is one recording (auto, the gap and teleop), named <event>-Q12-r0. Without the FMS it leaves record alone unless the dashboard's manual switch changes, so bench tests can drive it themselves.
  • Clock (6): the robot's wall clock every loop, for the Jetson's dates.
  • Excluded tags (11b, 12): a dashboard list, defaulting to the event config, published to the Jetson and also applied to single-tag solves.
  • Profile (11c): one dashboard switch sets every camera to pipeline 0 (event) or 1 (practice field); event is the default, so a forgotten switch can't carry practice settings into a match.
  • Alerts (7b, 8f, 9a, 9b): Jetson down, cameras out or slow, overheating, throttling, JPEG fallback, Rewind problems, stale timestamps, and a bumped camera mount.

Everything here reads logged inputs, and everything it sends goes through JetsonIO or OrinCameraIO, which are no-ops in replay.

  • Constructor Details

    • Jetson

      public Jetson(JetsonIO io, List<Jetson.Camera> cameras, int[] defaultExcludedTags, BooleanSupplier expectJetson)
      Parameters:
      io - the Jetson (JetsonIO.NONE in replay)
      cameras - the Orin cameras
      defaultExcludedTags - the event's bad tags, until changed on the dashboard
      expectJetson - whether the Jetson should be there (installed, and a real robot or a replay of one)
  • Method Details

    • isExpected

      public boolean isExpected()
      Whether the Jetson should answer: installed, on a real robot or a replay of one.
    • isPracticeFieldProfile

      public boolean isPracticeFieldProfile()
      Whether the dashboard has the Orin cameras on the practice-field pipeline.
    • isResponding

      public boolean isResponding()
      Whether the Jetson's heartbeat is ticking.
    • getCameras

      public List<Jetson.Camera> getCameras()
      The configured Orin cameras.
    • timestampsLookWrong

      public boolean timestampsLookWrong(String camera)
      Whether a camera's result timestamps have been far from now (a time-sync problem).
    • publishFieldMap

      public void publishFieldMap(String name, String hash, String json)
      Publishes the robot's field map for the Jetson to load (once, at boot).
      Parameters:
      name - the WPILib field's name, or "custom"
      hash - its canonical hash
      json - the layout as WPILib JSON
    • updateInputs

      public void updateInputs()
      Reads the Jetson. Call before the Orin sources update, so they see this loop's tag list.
    • periodic

      public void periodic(boolean robotStill)
      Sends the Jetson this loop's commands and updates the alerts.
      Parameters:
      robotStill - whether the robot is still enough for the mount check
    • getInputs

      public JetsonInputs getInputs()
    • getExcludedTags

      public Set<Integer> getExcludedTags()