Added to get limelight positioning

This commit is contained in:
2026-02-21 14:29:10 -06:00
parent 82c16b5402
commit c2e0b69c55
2 changed files with 17 additions and 4 deletions

View File

@@ -346,11 +346,13 @@ public class TeleopV3 extends LinearOpMode {
TELE.addData("Targeting GridY", targeting.robotGridY);
TELE.addData("Targeting FlyWheel", targetingSettings.flywheelRPM);
TELE.addData("Targeting HoodAngle", targetingSettings.hoodAngle);
TELE.addData("timeSinceStamp", getRuntime() - shootStamp);
TELE.addData("Voltage", voltage); // returns alleged recorded voltage (not same as driver hub)
// TELE.addData("timeSinceStamp", getRuntime() - shootStamp);
// TELE.addData("Voltage", voltage); // returns alleged recorded voltage (not same as driver hub)
TELE.addData("Avg Loop Time", loopTimes.getAvgLoopTime());
TELE.addData("Min Loop Time", loopTimes.getMinLoopTimeOneMin());
TELE.addData("Max Loop Time", loopTimes.getMaxLoopTimeOneMin());
TELE.addData("Tag Pos X", turret.getLimelightX());
TELE.addData("Tag Pos Y", turret.getLimelightY());
TELE.update();

View File

@@ -112,6 +112,14 @@ public class Turret {
limelightPosX = botpose.getPosition().x;
limelightPosY = botpose.getPosition().y;
}
List<LLResultTypes.FiducialResult> fiducials = result.getFiducialResults();
for (LLResultTypes.FiducialResult fiducial : fiducials) {
limelightTagPose = fiducial.getRobotPoseTargetSpace();
if (limelightTagPose != null){
limelightTagX = limelightTagPose.getPosition().x;
limelightTagY = limelightTagPose.getPosition().y;
}
}
}
}
@@ -127,12 +135,15 @@ public class Turret {
return ty;
}
Pose3D limelightTagPose;
double limelightTagX = 0.0;
double limelightTagY = 0.0;
public double getLimelightX() {
return limelightPosX;
return limelightTagX;
}
public double getLimelightY() {
return limelightPosY;
return limelightTagY;
}
public int detectObelisk() {