Added to get limelight positioning
This commit is contained in:
@@ -346,11 +346,13 @@ public class TeleopV3 extends LinearOpMode {
|
|||||||
TELE.addData("Targeting GridY", targeting.robotGridY);
|
TELE.addData("Targeting GridY", targeting.robotGridY);
|
||||||
TELE.addData("Targeting FlyWheel", targetingSettings.flywheelRPM);
|
TELE.addData("Targeting FlyWheel", targetingSettings.flywheelRPM);
|
||||||
TELE.addData("Targeting HoodAngle", targetingSettings.hoodAngle);
|
TELE.addData("Targeting HoodAngle", targetingSettings.hoodAngle);
|
||||||
TELE.addData("timeSinceStamp", getRuntime() - shootStamp);
|
// TELE.addData("timeSinceStamp", getRuntime() - shootStamp);
|
||||||
TELE.addData("Voltage", voltage); // returns alleged recorded voltage (not same as driver hub)
|
// TELE.addData("Voltage", voltage); // returns alleged recorded voltage (not same as driver hub)
|
||||||
TELE.addData("Avg Loop Time", loopTimes.getAvgLoopTime());
|
TELE.addData("Avg Loop Time", loopTimes.getAvgLoopTime());
|
||||||
TELE.addData("Min Loop Time", loopTimes.getMinLoopTimeOneMin());
|
TELE.addData("Min Loop Time", loopTimes.getMinLoopTimeOneMin());
|
||||||
TELE.addData("Max Loop Time", loopTimes.getMaxLoopTimeOneMin());
|
TELE.addData("Max Loop Time", loopTimes.getMaxLoopTimeOneMin());
|
||||||
|
TELE.addData("Tag Pos X", turret.getLimelightX());
|
||||||
|
TELE.addData("Tag Pos Y", turret.getLimelightY());
|
||||||
|
|
||||||
TELE.update();
|
TELE.update();
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ public class Turret {
|
|||||||
limelightPosX = botpose.getPosition().x;
|
limelightPosX = botpose.getPosition().x;
|
||||||
limelightPosY = botpose.getPosition().y;
|
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;
|
return ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Pose3D limelightTagPose;
|
||||||
|
double limelightTagX = 0.0;
|
||||||
|
double limelightTagY = 0.0;
|
||||||
public double getLimelightX() {
|
public double getLimelightX() {
|
||||||
return limelightPosX;
|
return limelightTagX;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getLimelightY() {
|
public double getLimelightY() {
|
||||||
return limelightPosY;
|
return limelightTagY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int detectObelisk() {
|
public int detectObelisk() {
|
||||||
|
|||||||
Reference in New Issue
Block a user