Class SynapseWrapper

java.lang.Object
yall.VisionCamera
yall.cameras.SynapseWrapper
All Implemented Interfaces:
AutoCloseable

public class SynapseWrapper extends VisionCamera
A Synapse camera.

Synapse reports target positions in pixels; this wrapper turns them into angles with the config's camera properties, so set them to match the camera. Synapse doesn't report target area or AprilTag ambiguity, so those are Double.NaN and the pose filter's ambiguity check is skipped.

Pose estimates come from Synapse's field-space camera pose and the config's robot-to-camera transform. Synapse has no heading-assisted mode, so PoseEstimationMode.HEADING_ASSISTED works like PoseEstimationMode.TAGS_ONLY.

Without camera properties in the config, it is simulated, and turns pixels into angles, as a CameraModel.ARDUCAM_OV9281.

No vendor configs are accepted; use getCamera() for Synapse settings.

  • Constructor Details

    • SynapseWrapper

      public SynapseWrapper(synapse.SynapseCamera camera, VisionCameraConfig config)
      Wraps a Synapse camera.
      Parameters:
      camera - The Synapse camera.
      config - The camera's config.
  • Method Details

    • readFrames

      protected List<VisionFrame> readFrames()
      Description copied from class: VisionCamera
      Reads the frames the real camera produced since the last call. Call once per loop.
      Specified by:
      readFrames in class VisionCamera
      Returns:
      The frames, oldest first.
    • applyPipelineIndex

      protected void applyPipelineIndex(int index)
      Description copied from class: VisionCamera
      Switches the real camera's pipeline.
      Specified by:
      applyPipelineIndex in class VisionCamera
      Parameters:
      index - Pipeline index.
    • readPipelineIndex

      protected int readPipelineIndex()
      Description copied from class: VisionCamera
      Reads the real camera's pipeline.
      Specified by:
      readPipelineIndex in class VisionCamera
      Returns:
      Pipeline index.
    • readConnected

      protected boolean readConnected()
      Description copied from class: VisionCamera
      Whether the real camera is sending data.
      Specified by:
      readConnected in class VisionCamera
      Returns:
      true if connected.
    • applyRobotToCamera

      protected void applyRobotToCamera(Transform3d robotToCamera)
      Description copied from class: VisionCamera
      Passes a new camera position to the real camera, for cameras that use it themselves.
      Overrides:
      applyRobotToCamera in class VisionCamera
      Parameters:
      robotToCamera - Transform from the robot origin to the camera.
    • getCamera

      public synapse.SynapseCamera getCamera()
      Description copied from class: VisionCamera
      The vendor's camera object, for settings YALL doesn't cover. Each wrapper narrows the return type to its vendor's class.
      Specified by:
      getCamera in class VisionCamera
      Returns:
      The vendor's camera object.
    • close

      public void close()
      Closes the results subscriber, then the parts every camera shares.
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class VisionCamera