Vision
Esta página ainda não foi traduzida. Mostrando a versão em inglês.
EasyStack includes two vision helpers that detect balls and compute how the robot must turn to aim at them. Both follow the same lifecycle and the same aiming methods, so you can switch between them with few changes.
#Choosing a Camera
EasyCamera: a webcam connected to the Control Hub, processed on the robot with a built-in ball detection pipeline. Colors are PURPLE, GREEN or ANY.EasyLimelight: a Limelight 3A that does the processing on the camera. It also reads AprilTags and gives the robot pose.
#Common Lifecycle
start(): starts the camera.EasyCameraalso registers its stream with the dashboard.update(): call it once per loop to read the latest result.pause()/resume(): stops and restarts processing without closing the camera.stop(): stops the camera. Always call it when theOpModeends.
#Aiming
Both classes calculate how much the robot has to turn to center the target:
getAimError(): how far the target is from the center of the image.getAimPower(): a turn power, calculated with a proportional gain, a deadband and a maximum power.isAligned(): true when the error is inside the tolerance.setAimGain(kP),setAimDeadband(d),setAimTolerance(t),setAimMaxPower(p),setAimDirection(d): tune the aiming.
Java
camera.update();
if (camera.hasBall() && !camera.isAligned()) {
drive.driveRobotCentric(0, 0, camera.getAimPower());
}#Dashboard
When a camera is started, its live image shows up in the Camera panel of the dashboard, with a marker over the detected ball. See the EasyDash tab.
Última atualização 2026-11-16