Class MARSVision

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
com.marslib.vision.MARSVision
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

public class MARSVision extends edu.wpi.first.wpilibj2.command.SubsystemBase
Central aggregator for all visual and SLAM external odometry integrations.

Students: This subsystem actively pools array data from unlimited AprilTag and VIO SLAM pipelines. It analyzes the physical ambiguity of every target, scales standard deviations dynamically, and executes strict multi-factor 254-style rejection conditions before passing coordinates into the SwerveDrive Pose Estimator.

  • Constructor Summary

    Constructors
    Constructor
    Description
    MARSVision(SwerveDrive swerveDrive, List<AprilTagVisionIO> aprilTagIOs, List<VIOSlamIO> slamIOs, VisionConfig config)
    Constructs the absolute Vision mapping structure.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<edu.wpi.first.math.geometry.Translation2d>
    Retrieves the latest, rigorously vetted vision-based target translation.
    void
    The active periodic layer.

    Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase

    addChild, getName, getSubsystem, initSendable, setName, setSubsystem

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem

    defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
  • Constructor Details

    • MARSVision

      public MARSVision(SwerveDrive swerveDrive, List<AprilTagVisionIO> aprilTagIOs, List<VIOSlamIO> slamIOs, VisionConfig config)
      Constructs the absolute Vision mapping structure.
      Parameters:
      swerveDrive - The primary SwerveDrive subsystem reference for data injection.
      aprilTagIOs - A list of all active AprilTag IO architectures (Limelight, Photon).
      slamIOs - A list of all active VIO SLAM IO architectures (QuestNav, ROS2).
      config - The global vision configuration.
  • Method Details

    • periodic

      public void periodic()
      The active periodic layer. Scans through all mapped interfaces exactly once per loop. Executes advanced field constraints, motion blur rejection, and ambiguity thresholding natively.
    • getBestTargetTranslation

      public Optional<edu.wpi.first.math.geometry.Translation2d> getBestTargetTranslation()
      Retrieves the latest, rigorously vetted vision-based target translation. This provides a direct fallback for SOTM and aiming loops if odometry is drifting.