Limelight Distance Measurement Issue

Hi, we just bought a limelight 3 and i am trying to measure the distance to apriltag can you help me?
Do you have any github repository for this?

Limelight has a built in estimator pipeline. Once you are connected to the limelight interface you can tune the pipeline and set offset, etc. Then in the code you can either use the LimelightHelpers “library” that they created (you do need to install it) or do it the more traditional way of getting the info from network tables. Look under the network tables documentation on limelights’ website, I’ll post the code we used this year in a bit.

We have our limelight subsystem here: https://github.com/frc3197/2023-Charged-Up/blob/main/2023-Charged-Up/src/main/java/frc/robot/subsystems/Limelight.java
The main lines you need:
table = NetworkTableInstance.getDefault().getTable(limelightName);
pose = table.getEntry(“botpose_targetspace”).getDoubleArray(new double[6]);
This returns the offset from robot to tag in the format of an array, check out this: Complete NetworkTables API — Limelight 1.0 documentation

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.