Skip to content

Commit

Permalink
Add vision telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
mlists committed Mar 16, 2024
1 parent 4978c97 commit 72ac4ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class VisualLocalizer:
add_to_estimator = tunable(True)
should_log = tunable(False)

last_was_multi = tunable(False)

last_pose_z = tunable(0.0, writeDefault=False)

def __init__(
Expand Down Expand Up @@ -77,6 +79,7 @@ def execute(self) -> None:
self.last_timestamp = timestamp

if results.multiTagResult.estimatedPose.isPresent:
self.last_was_multi = True
p = results.multiTagResult.estimatedPose
pose = (Pose3d() + p.best + self.camera_to_robot).toPose2d()
reprojectionErr = p.bestReprojError
Expand Down Expand Up @@ -106,6 +109,7 @@ def execute(self) -> None:
)
)
else:
self.last_was_multi = False
for target in results.getTargets():
# filter out likely bad targets
if target.getPoseAmbiguity() > 0.25:
Expand Down

0 comments on commit 72ac4ad

Please sign in to comment.