Skip to content

Commit 11bd4b0

Browse files
committed
Bugfix: actually iterate over all groups
1 parent c87e784 commit 11bd4b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def relative_bearing_to_best_cluster(self) -> Rotation2d:
137137
relative_bearings = [tag.relative_bearing for tag in tags]
138138
relative_bearings.sort(key=Rotation2d.radians)
139139
for offset in range(len(relative_bearings) - 1, 0, -1):
140-
bearing_pairs = zip(relative_bearings, relative_bearings[offset:-1])
140+
bearing_pairs = zip(relative_bearings, relative_bearings[offset:])
141141
for pair in bearing_pairs:
142142
if abs((pair[0] - pair[1]).radians()) < self.CAMERA_FOV:
143143
return (pair[1] - pair[0]) * 0.5 + pair[0]

0 commit comments

Comments
 (0)