Package frc.robot.vision
Class Vision
java.lang.Object
frc.robot.vision.Vision
- All Implemented Interfaces:
edu.wpi.first.networktables.NTSendable,edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class Vision
extends Object
implements edu.wpi.first.networktables.NTSendable, edu.wpi.first.wpilibj2.command.Subsystem
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.wpilibj2.command.CommandSet all Limelights to blinkedu.wpi.first.math.geometry.Pose2dChoose the limelight with the best view of multiple tagsintLimelightsedu.wpi.first.math.geometry.Pose2dgetName()edu.wpi.first.math.geometry.Pose2dstatic edu.wpi.first.apriltag.AprilTagFieldLayoutdoublegetTagTA()doublegetTagTX()booleanIf at least one LL has an accurate posevoidinitSendable(edu.wpi.first.networktables.NTSendableBuilder builder) booleanisAiming()booleanbooleanvoidperiodic()voidreset pose to the best limelight's vision posebooleanresetPoseToVision(boolean targetInView, edu.wpi.first.math.geometry.Pose3d botpose3D, edu.wpi.first.math.geometry.Pose2d megaPose, double poseTimestamp) Set robot pose to vision pose only if LL has good tag readingsetIntegrating(boolean isIntegrating) voidsetLimelightPipelines(int pipeline) Change all LL pipelines to the same pipelineedu.wpi.first.wpilibj2.command.CommandOnly blinks left limelightbooleanvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.networktables.NTSendable
initSendableMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
frontLL
Limelights -
backLL
-
allLimelights
-
-
Constructor Details
-
Vision
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceedu.wpi.first.wpilibj2.command.Subsystem
-
telemetryInit
public void telemetryInit() -
periodic
public void periodic()- Specified by:
periodicin interfaceedu.wpi.first.wpilibj2.command.Subsystem
-
getFrontMegaTag2Pose
public edu.wpi.first.math.geometry.Pose2d getFrontMegaTag2Pose() -
getBackMegaTag2Pose
public edu.wpi.first.math.geometry.Pose2d getBackMegaTag2Pose() -
initSendable
public void initSendable(edu.wpi.first.networktables.NTSendableBuilder builder) - Specified by:
initSendablein interfaceedu.wpi.first.networktables.NTSendable
-
getBestLimelight
Choose the limelight with the best view of multiple tags- Returns:
-
resetPoseToVision
public void resetPoseToVision()reset pose to the best limelight's vision pose -
resetPoseToVision
public boolean resetPoseToVision(boolean targetInView, edu.wpi.first.math.geometry.Pose3d botpose3D, edu.wpi.first.math.geometry.Pose2d megaPose, double poseTimestamp) Set robot pose to vision pose only if LL has good tag reading- Returns:
- if the pose was accepted and integrated
-
hasAccuratePose
public boolean hasAccuratePose()If at least one LL has an accurate pose- Returns:
-
setLimelightPipelines
public void setLimelightPipelines(int pipeline) Change all LL pipelines to the same pipeline -
getClosestTagID
public int getClosestTagID() -
isRearTagClosest
public boolean isRearTagClosest() -
tagsInView
public boolean tagsInView() -
getTagTA
public double getTagTA() -
getTagTX
public double getTagTX() -
getReefOffsetFromTag
public edu.wpi.first.math.geometry.Pose2d getReefOffsetFromTag() -
blinkLimelights
public edu.wpi.first.wpilibj2.command.Command blinkLimelights()Set all Limelights to blink -
solidLimelight
public edu.wpi.first.wpilibj2.command.Command solidLimelight()Only blinks left limelight -
getFrontLL
Limelights -
isIntegrating
public boolean isIntegrating() -
setIntegrating
- Returns:
this.
-
isAiming
public boolean isAiming() -
getTagLayout
public static edu.wpi.first.apriltag.AprilTagFieldLayout getTagLayout()
-