Skip to content
Hive Vision

Hive Tags Setup

Set up Hive Tags AprilTag detection with a Limelight 3A or a USB webcam

Hive Tags reads the AprilTag clusters on hive cells and scores them against your alliance rules. It runs on a Limelight 3A or a USB webcam, with a live dashboard in the browser.

Prerequisites:

  • FTC SDK 12.0+
  • Android Studio
  • Limelight 3A, USB webcam, or both

Two ways to install — pick one.

Use this repository. Clone it, open the FtcRobotController/ folder in Android Studio, let Gradle sync, then build and deploy to the Robot Controller as usual.

Terminal window
git clone https://github.com/hivevisionftc/Hive-Tags.git

Add it to your own robot project. Add the seven Hive Tags files in TeamCode/ of your FTC project — they depend only on the FTC SDK:

  • DirectoryTeamCode
    • Directoryjava
      • Directoryorg.firstinspires.ftc.teamcode
        • AprilTagDashboardOpMode.java //runs detection and the dashboard. This is the OpMode you start
        • AprilTagTelemetryOpMode.java //webcam check that prints detections to telemetry
        • AprilTagDashboardServer.java //the dashboard’s HTTP server and embedded page
        • AprilTagConfig.java //settings the dashboard can change at runtime
        • AprilTagTargeting.java //alliance, roll and cluster rules
        • LimelightBridge.java //Limelight results to SDK detections, and the tag size patcher
        • MjpegFrameGrabber.java //encodes webcam frames for the live view

Paste in each file from the repository: AprilTagDashboardOpMode.java · AprilTagTelemetryOpMode.java · AprilTagDashboardServer.java · AprilTagConfig.java · AprilTagTargeting.java · LimelightBridge.java · MjpegFrameGrabber.java

  1. Name the Limelight limelight in the Driver Station configuration.
  2. Run the AprilTag Dashboard OpMode and set source to LIMELIGHT.
  3. Make sure the camera is on a pipeline that detects AprilTags (pipe_fiducial).

Drag the tag size slider to your tag’s real size, then press push tag size to Limelight. If the Limelight is not at limelight.local, type its hostname or IP in the host box — the page, the REST calls and the video all follow it.

  1. Plug the webcam into the Control Hub and name it Webcam 1 in the Driver Station configuration.
  2. Run the AprilTag Dashboard OpMode with source set to WEBCAM.

A different name? Type it in the camera name box and the stream rebuilds. To check a webcam before using the dashboard, run AprilTag Telemetry (Webcam) — it only prints detections to the Driver Station.

The OpMode prints its address in Driver Station telemetry. It asks for port 8080 and moves to the next free port if that one is taken.

Connection URL
Laptop on the robot’s network The Dashboard: line from telemetry, for example http://192.168.43.1:8082
Control Hub over USB Run adb reverse tcp:8082 tcp:8082 with your port, then open http://localhost:8082