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.Command
Set all Limelights to blinkedu.wpi.first.math.geometry.Pose2d
Choose the limelight with the best view of multiple tagsint
Limelightsedu.wpi.first.math.geometry.Pose2d
getName()
edu.wpi.first.math.geometry.Pose2d
static edu.wpi.first.apriltag.AprilTagFieldLayout
double
getTagTA()
double
getTagTX()
boolean
If at least one LL has an accurate posevoid
initSendable
(edu.wpi.first.networktables.NTSendableBuilder builder) boolean
isAiming()
boolean
boolean
void
periodic()
void
reset pose to the best limelight's vision poseboolean
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 readingsetIntegrating
(boolean isIntegrating) void
setLimelightPipelines
(int pipeline) Change all LL pipelines to the same pipelineedu.wpi.first.wpilibj2.command.Command
Only blinks left limelightboolean
void
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.networktables.NTSendable
initSendable
Methods 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:
getName
in interfaceedu.wpi.first.wpilibj2.command.Subsystem
-
telemetryInit
public void telemetryInit() -
periodic
public void periodic()- Specified by:
periodic
in 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:
initSendable
in 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()
-