Class Vision
java.lang.Object
com.stuypulse.robot.util.PeriodicSubsystem
com.stuypulse.robot.subsystems.vision.Vision
- All Implemented Interfaces:
org.wpilib.command3.Mechanism
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Vision.VisionConsumerprivate final EnumMap<VisionConstants.Camera, org.wpilib.util.Alert> private final org.wpilib.system.Timerprivate final EnumMap<VisionConstants.Camera, com.stuypulse.robot.subsystems.vision.VisionIOInputsAutoLogged> private final EnumMap<VisionConstants.Camera, VisionIO> private final EnumMap<VisionConstants.Camera, VisionIO.VisionIOOutputs> -
Constructor Summary
ConstructorsConstructorDescriptionVision(Vision.VisionConsumer consumer, EnumMap<VisionConstants.Camera, VisionIO> cameraIOMap) -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()voidenable()org.wpilib.math.geometry.Rotation2dgetTargetX(VisionConstants.Camera camera) Returns the X angle to the best target, which can be used for simple servoing with vision.voidperiodic()This method is called periodically beforeScheduler.run(), and should be overriden for processing inputs.voidThis method is called periodically afterScheduler.run(), and should be overriden for applying outputs.org.wpilib.command3.CommandresetIMU()org.wpilib.command3.CommandsetAprilTagWhitelist(int[] whitelist) org.wpilib.command3.CommandsetIMUMode(int imuMode) private org.wpilib.command3.CommandsetIMUMode(int imuMode, String name) org.wpilib.command3.Commandorg.wpilib.command3.CommandsetPipeline(int pipeline) org.wpilib.command3.Commandorg.wpilib.command3.CommandMethods inherited from class PeriodicSubsystem
getName, runAllPeriodicAfterScheduler, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.wpilib.command3.Mechanism
controllableDuringDisabled, getDefaultCommand, getRegisteredScheduler, getRunningCommands, idle, idleFor, run, runRepeatedly, setDefaultCommand
-
Field Details
-
consumer
-
io
-
inputs
private final EnumMap<VisionConstants.Camera, com.stuypulse.robot.subsystems.vision.VisionIOInputsAutoLogged> inputs -
outputs
-
disconnectedAlerts
-
hdrTimer
-
-
Constructor Details
-
Vision
public Vision(Vision.VisionConsumer consumer, EnumMap<VisionConstants.Camera, VisionIO> cameraIOMap)
-
-
Method Details
-
getTargetX
Returns the X angle to the best target, which can be used for simple servoing with vision.- Parameters:
camera- The camera to use
-
getPipeline
-
periodic
Description copied from class:PeriodicSubsystemThis method is called periodically beforeScheduler.run(), and should be overriden for processing inputs.- Specified by:
periodicin classPeriodicSubsystem
-
periodicAfterScheduler
Description copied from class:PeriodicSubsystemThis method is called periodically afterScheduler.run(), and should be overriden for applying outputs.- Overrides:
periodicAfterSchedulerin classPeriodicSubsystem
-
enable
-
disable
-
setPipeline
-
setMegaTagMode
-
setVisionEnabled
-
setVisionDisabled
-
setAprilTagWhitelist
-
setIMUMode
-
setIMUMode
-
resetIMU
-