You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -27,16 +29,31 @@ class AprilTagsTest : BaseOpMode() {
27
29
28
30
privatefunfieldPosition() {
29
31
val detections = processor.detections
30
-
//TODO: Avg position if given multiple tags?
32
+
//TODO: Avg position if given multiple tags?
31
33
for (detection in detections) {
32
-
val tagPosition =listOf(detection.metadata.fieldPosition[0], detection.metadata.fieldPosition[1], detection.metadata.fieldPosition[2])
33
-
val fieldPositionWithTag =listOf((tagPosition[0]+detection.ftcPose.x).toFloat(), (tagPosition[1]+detection.ftcPose.y).toFloat(), (tagPosition[1]+detection.ftcPose.z).toFloat())
telemetry.addLine("--Field Position From Tag (x, y, z): (%.2f, %.2f, %.2f)".format(fieldPositionWithTag[0], fieldPositionWithTag[1], fieldPositionWithTag[2]))
46
+
telemetry.addLine(
47
+
"--Field Position From Tag (x, y, z): (%.2f, %.2f, %.2f)".format(
48
+
fieldPositionWithTag[0],
49
+
fieldPositionWithTag[1],
50
+
fieldPositionWithTag[2],
51
+
),
52
+
)
36
53
telemetry.addLine("--Bot Position (x, y): (%.2f, %.2f)".format(bot.pinpoint?.pose?.x, bot.pinpoint?.pose?.y))
37
-
38
54
}
39
55
}
56
+
40
57
@Deprecated("ts sucks just use the library")
41
58
privatefuncalculateAprilTag() {
42
59
val detections = processor.detections
@@ -88,5 +105,4 @@ class AprilTagsTest : BaseOpMode() {
0 commit comments