Skip to content

Commit 1962ba0

Browse files
committed
changed getTargetX
Function treats cameraIndex as which camera the function returns a target for. Previously, function would return position of targetter Apriltag.
1 parent fb9dcae commit 1962ba0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/frc/robot/subsystems/vision/Vision.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,22 @@ public Vision(VisionConsumer consumer, VisionIO... io) {
5656
* @param cameraIndex The index of the camera to use.
5757
*/
5858
public Rotation2d getTargetX(int cameraIndex) {
59-
for (int i : inputs[0].tagIds) {
59+
DriverStation.reportWarning(Double.toString(inputs[cameraIndex].latestTargetObservation.tx().getDegrees()), false);
60+
return inputs[cameraIndex].latestTargetObservation.tx();
61+
62+
/**for (int i : inputs[0].tagIds) {
6063
DriverStation.reportWarning(Integer.toString(i), false);
6164
var tagPose = aprilTagLayout.getTagPose(i);
65+
DriverStation.reportWarning(
66+
Double.toString(
67+
tagPose.get().getRotation().toRotation2d().plus(Rotation2d.kPi).getDegrees()),
68+
false);
6269
if (i == cameraIndex) {
6370
return tagPose.get().getRotation().toRotation2d().plus(Rotation2d.kPi);
6471
}
6572
}
6673
return Rotation2d.kZero;
74+
*/
6775
}
6876

6977
@Override

0 commit comments

Comments
 (0)