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 ClassesModifier and TypeClassDescriptionstatic classclass -
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 tagsedu.wpi.first.math.geometry.Pose2dedu.wpi.first.math.geometry.Pose2dgetName()edu.wpi.first.math.geometry.Pose2dstatic edu.wpi.first.apriltag.AprilTagFieldLayoutedu.wpi.first.math.geometry.Pose2dedu.wpi.first.math.geometry.Pose2dbooleanIf at least one LL has an accurate posevoidinitSendable(edu.wpi.first.networktables.NTSendableBuilder builder) booleanvoidperiodic()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 readingvoidsetLimelightPipelines(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, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
frontLL
-
backLL
-
leftLL
-
rightLL
-
turretLL
-
allLimelights
-
swerveLimelights
-
-
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() -
getLeftMegaTag2Pose
public edu.wpi.first.math.geometry.Pose2d getLeftMegaTag2Pose() -
getRightMegaTag2Pose
public edu.wpi.first.math.geometry.Pose2d getRightMegaTag2Pose() -
getTurretMegaTag2Pose
public edu.wpi.first.math.geometry.Pose2d getTurretMegaTag2Pose() -
getTurretMegaTag1Pose
public edu.wpi.first.math.geometry.Pose2d getTurretMegaTag1Pose() -
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:
- the best limelight
-
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:
- true if at least one LL has an accurate pose
-
setLimelightPipelines
public void setLimelightPipelines(int pipeline) Change all LL pipelines to the same pipeline -
isTurretSeeingTag
public boolean isTurretSeeingTag() -
tagsInView
public boolean tagsInView() -
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
-
getBackLL
-
getLeftLL
-
getRightLL
-
getTurretLL
-
getTurretRotationSupplier
-
getTagLayout
public static edu.wpi.first.apriltag.AprilTagFieldLayout getTagLayout()
-