AlphaBit OpenML
2026
Documentation
AprilTag Detection - Getting Started
AprilTag Beginner Flow
This is the step-by-step implementation path for AprilTag in Decode. The goal is to make pattern detection and pose correction reproducible for beginner FTC teams.
Step 1
Mount and Verify the Webcam
  • Use hardware map name AlphaBit_Webcam.
  • Lock camera mount mechanically so pitch/yaw do not shift during impacts.
  • Set the camera pose offsets in code only after physical mount is final.
  • Webcam setup step 0
    Initial webcam setup reference.
    Webcam setup step 1
    Verify orientation and stable FOV.
    Step 2
    Initialize AprilTagProcessor and VisionPortal
    Use the same pipeline style as drive/ComputerVision/AprilTagIdentification.java:
    aprilTagProcessor = new AprilTagProcessor.Builder()
        .setDrawTagID(true)
        .setDrawTagOutline(true)
        .setDrawAxes(true)
        .setDrawCubeProjection(true)
        .setOutputUnits(DistanceUnit.INCH, AngleUnit.DEGREES)
        .setCameraPose(cameraPosition, cameraOrientation)
        .build();
    
    VisionPortal.Builder builder = new VisionPortal.Builder();
    builder.setCamera(hwdmap.get(WebcamName.class, "AlphaBit_Webcam"));
    builder.setCameraResolution(new Size(640, 480));
    builder.addProcessor(aprilTagProcessor);
    visionPortal = builder.build();
    Step 3
    Implement Two ID Groups
  • Pattern IDs for game logic: 21 / 22 / 23.
  • Localization IDs for pose refresh: 20 / 24.
  • Keep these groups separate in code so your autonomous decisions remain predictable.
    Step 4
    Read Tags During Init and Runtime
  • During opModeInInit(), lock pattern ID before match start.
  • During runtime, call pose read only when your safety gates allow correction.
  • Push X/Y/bearing telemetry to DS for quick confidence checks.
  • Step 5
    Validate Under Match Lighting
  • Test near bright and dark field zones; don't validate only in pit lighting.
  • Verify camera can still detect IDs after quick turns and hard braking.
  • If detections flicker, reduce trust windows and increase stationary-only corrections.
  • Never hard-reset pose while robot is rotating aggressively.
    Next
    Open AprilTag Implementation for a full class-level template and integration snippets.
    Setup
    AprilTag Detection

    Getting Started

    Autonomous Control
    Auto Aiming Turret
    Need help with OpenML? Ask the AlphaBit assistant

    AlphaBit AI Assistant

    Hi! I can help with model setup, training data, and robotics ML workflow questions.