Skip to content

Commit

Permalink
vision: Remove redundant .radians() in Pose2d conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed May 19, 2024
1 parent 1f229b5 commit fa648b2
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions components/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,10 @@ def execute(self) -> None:

if self.should_log:
self.multi_best_log.setPose(
Pose2d(
p.best.x,
p.best.y,
p.best.rotation().toRotation2d().radians(),
)
Pose2d(p.best.x, p.best.y, p.best.rotation().toRotation2d())
)
self.multi_alt_log.setPose(
Pose2d(
p.alt.x,
p.alt.y,
p.alt.rotation().toRotation2d().radians(),
)
Pose2d(p.alt.x, p.alt.y, p.alt.rotation().toRotation2d())
)
else:
for target in results.getTargets():
Expand Down Expand Up @@ -133,18 +125,14 @@ def execute(self) -> None:
Pose2d(
target.bestCameraToTarget.x,
target.bestCameraToTarget.y,
target.bestCameraToTarget.rotation()
.toRotation2d()
.radians(),
target.bestCameraToTarget.rotation().toRotation2d(),
)
)
self.single_alt_log.setPose(
Pose2d(
target.altCameraToTarget.x,
target.altCameraToTarget.y,
target.altCameraToTarget.rotation()
.toRotation2d()
.radians(),
target.altCameraToTarget.rotation().toRotation2d(),
)
)

Expand Down

0 comments on commit fa648b2

Please sign in to comment.