diff --git a/photon-lib/py/photonlibpy/photonCamera.py b/photon-lib/py/photonlibpy/photonCamera.py index c7635dca58..c3ac1ddcae 100644 --- a/photon-lib/py/photonlibpy/photonCamera.py +++ b/photon-lib/py/photonlibpy/photonCamera.py @@ -19,11 +19,11 @@ from typing import List import ntcore +import wpilib +from wpilib import RobotController, Timer # magical import to make serde stuff work import photonlibpy.generated # noqa -import wpilib -from wpilib import RobotController, Timer from .packet import Packet from .targeting.photonPipelineResult import PhotonPipelineResult diff --git a/photon-lib/py/photonlibpy/targeting/multiTargetPNPResult.py b/photon-lib/py/photonlibpy/targeting/multiTargetPNPResult.py index d505fd5afb..1eb03ea603 100644 --- a/photon-lib/py/photonlibpy/targeting/multiTargetPNPResult.py +++ b/photon-lib/py/photonlibpy/targeting/multiTargetPNPResult.py @@ -3,8 +3,6 @@ from wpimath.geometry import Transform3d -from ..packet import Packet - if TYPE_CHECKING: from .. import generated diff --git a/photon-lib/py/test/photonPoseEstimator_test.py b/photon-lib/py/test/photonPoseEstimator_test.py index 5f9787e43a..8988f04a8e 100644 --- a/photon-lib/py/test/photonPoseEstimator_test.py +++ b/photon-lib/py/test/photonPoseEstimator_test.py @@ -15,6 +15,9 @@ ## along with this program. If not, see . ############################################################################### +from robotpy_apriltag import AprilTag, AprilTagFieldLayout +from wpimath.geometry import Pose3d, Rotation3d, Transform3d, Translation3d + from photonlibpy import PhotonPoseEstimator, PoseStrategy from photonlibpy.targeting import ( PhotonPipelineMetadata, @@ -23,8 +26,6 @@ ) from photonlibpy.targeting.multiTargetPNPResult import MultiTargetPNPResult, PnpResult from photonlibpy.targeting.photonPipelineResult import PhotonPipelineResult -from robotpy_apriltag import AprilTag, AprilTagFieldLayout -from wpimath.geometry import Pose3d, Rotation3d, Transform3d, Translation3d class PhotonCameraInjector: diff --git a/photon-lib/py/test/photonlibpy_test.py b/photon-lib/py/test/photonlibpy_test.py index 8835c99773..2610358fa8 100644 --- a/photon-lib/py/test/photonlibpy_test.py +++ b/photon-lib/py/test/photonlibpy_test.py @@ -18,6 +18,7 @@ from time import sleep import ntcore + from photonlibpy import PhotonCamera from photonlibpy.photonCamera import setVersionCheckEnabled diff --git a/photon-lib/py/test/visionSystemSim_test.py b/photon-lib/py/test/visionSystemSim_test.py index 4851f81909..0648e39576 100644 --- a/photon-lib/py/test/visionSystemSim_test.py +++ b/photon-lib/py/test/visionSystemSim_test.py @@ -2,9 +2,6 @@ import ntcore as nt import pytest -from photonlibpy.estimation import TargetModel, VisionEstimation -from photonlibpy.photonCamera import PhotonCamera, setVersionCheckEnabled -from photonlibpy.simulation import PhotonCameraSim, VisionSystemSim, VisionTargetSim from robotpy_apriltag import AprilTag, AprilTagFieldLayout from wpimath.geometry import ( Pose2d, @@ -17,6 +14,10 @@ ) from wpimath.units import feetToMeters, meters +from photonlibpy.estimation import TargetModel, VisionEstimation +from photonlibpy.photonCamera import PhotonCamera, setVersionCheckEnabled +from photonlibpy.simulation import PhotonCameraSim, VisionSystemSim, VisionTargetSim + @pytest.fixture(autouse=True) def setupCommon() -> None: diff --git a/photonlib-python-examples/aimandrange/robot.py b/photonlib-python-examples/aimandrange/robot.py index a91bcbbd4a..76f733170f 100644 --- a/photonlib-python-examples/aimandrange/robot.py +++ b/photonlib-python-examples/aimandrange/robot.py @@ -27,6 +27,7 @@ import drivetrain import wpilib + from photonlibpy import PhotonCamera VISION_TURN_kP = 0.01 diff --git a/photonlib-python-examples/aimattarget/robot.py b/photonlib-python-examples/aimattarget/robot.py index 692ca7f165..e6f2890634 100644 --- a/photonlib-python-examples/aimattarget/robot.py +++ b/photonlib-python-examples/aimattarget/robot.py @@ -26,6 +26,7 @@ import drivetrain import wpilib + from photonlibpy import PhotonCamera VISION_TURN_kP = 0.01 diff --git a/photonlib-python-examples/poseest/robot.py b/photonlib-python-examples/poseest/robot.py index 9d82d17a01..f55a06b22e 100644 --- a/photonlib-python-examples/poseest/robot.py +++ b/photonlib-python-examples/poseest/robot.py @@ -27,9 +27,10 @@ import drivetrain import wpilib import wpimath.geometry -from photonlibpy import PhotonCamera, PhotonPoseEstimator, PoseStrategy from robotpy_apriltag import AprilTagField, loadAprilTagLayoutField +from photonlibpy import PhotonCamera, PhotonPoseEstimator, PoseStrategy + kRobotToCam = wpimath.geometry.Transform3d( wpimath.geometry.Translation3d(0.5, 0.0, 0.5), wpimath.geometry.Rotation3d.fromDegrees(0.0, -30.0, 0.0),