Class Camera
- All Implemented Interfaces:
Subsystem
Turret
that follows the goal, a Launcher whose speed comes from the distance.
camera = add(Camera.limelight("limelight").goal("BLUE SCORING", "RED SCORING")); // Robot.java
goal(String, String) names this season's goal for each alliance (the tag group's
name); goal() then gives the target for the alliance chosen in autonomous. Tunables
(Tunables.Limelight for device "limelight"): pipeline (Limelight only, default 0).
No suggested buttons. It starts in INIT (a webcam needs a second or two). A camera missing from the
robot configuration never stops the OpMode: it warns on the Driver Station and sees nothing.
Venue lighting: autoPipelines (Limelight) or autoExposure() (webcam) tries a few
camera settings in INIT and keeps the one that sees the most AprilTags; the Driver Station shows the
result at INIT. Its numbers are optional Tunables: autoLighting (true; false = skip the test
and use pipeline, or the webcam's exposureMs and gain), lightingSettleMs
(300), lightingPictures (10), lightingMinPictures (3), lightingAfterStartMs
(0 = stop at START with the best so far), and for a webcam gain (-1 = the camera's highest).
Docs: docs/modules/robot.md (section "Camera"), docs/modules/vision.md
-
Method Summary
Modifier and TypeMethodDescriptionvoidThe part's telemetry line; each module adds its own.Venue lighting for a webcam: tries the camera's own automatic exposure, then 3, 6 and 12 ms, in INIT and keeps the one that sees the most AprilTags.autoExposure(long... exposuresMs) Venue lighting for a webcam: tries these exposures (milliseconds; 0 = the camera's own automatic exposure) in INIT and keeps the one that sees the most AprilTags.autoPipelines(int... pipelines) Venue lighting for a Limelight: tries these pipelines in INIT and keeps the one that sees the most AprilTags (set each one up on the Limelight's web page for a kind of light).goal()The goal for this match's alliance (seegoal(String, String)), or null if it is not seen now (or no goal was named).The goal's tag group for each alliance, e.g.lighting()The venue-lighting test (status and result), or null when it is off.static CameraA Limelight 3A.source()The camera inside (a LimelightTags or WebcamTags), for anything this module does not offer.voidstop()Stops all motion.target(int id) The tag with this number, or null if not seen now.The target with this name (a tag group or a tag's name), or null if not seen now.voidupdate()Called once every loop.static CameraA webcam (USB).
-
Method Details
-
limelight
A Limelight 3A. -
webcam
A webcam (USB). -
goal
The goal's tag group for each alliance, e.g. "BLUE SCORING" and "RED SCORING" in BIOBUZZ.- Parameters:
blueGroup- the group the BLUE alliance aims atredGroup- the group the RED alliance aims at
-
autoPipelines
Venue lighting for a Limelight: tries these pipelines in INIT and keeps the one that sees the most AprilTags (set each one up on the Limelight's web page for a kind of light). Your usual pipeline FIRST: it wins ties and is kept if no tag is seen. See docs/modules/vision.md.camera = add(Camera.limelight("limelight").autoPipelines(0, 1, 2).goal("BLUE SCORING", "RED SCORING"));- Parameters:
pipelines- the pipeline numbers to try, usual one first
-
autoExposure
Venue lighting for a webcam: tries the camera's own automatic exposure, then 3, 6 and 12 ms, in INIT and keeps the one that sees the most AprilTags. SeeautoExposure(long...). -
autoExposure
Venue lighting for a webcam: tries these exposures (milliseconds; 0 = the camera's own automatic exposure) in INIT and keeps the one that sees the most AprilTags. Usual one FIRST.- Parameters:
exposuresMs- the exposures to try, usual one first
-
lighting
The venue-lighting test (status and result), or null when it is off. -
goal
The goal for this match's alliance (seegoal(String, String)), or null if it is not seen now (or no goal was named). Always check for null. -
target
The target with this name (a tag group or a tag's name), or null if not seen now. -
target
The tag with this number, or null if not seen now. -
source
The camera inside (a LimelightTags or WebcamTags), for anything this module does not offer. -
update
public void update()Description copied from interface:SubsystemCalled once every loop. Do the hardware work here. Must be quick: no sleep, no waiting. While update() waits, the whole robot is frozen (no driving, no limits, no STOP). -
stop
public void stop()Description copied from interface:SubsystemStops all motion. Called at the end of every OpMode. -
addTelemetry
Description copied from class:ModuleThe part's telemetry line; each module adds its own.- Specified by:
addTelemetryin interfaceSubsystem- Overrides:
addTelemetryin classModule<Camera>
-