mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
Break up masssive python overload hacks (#1573)
What it says on the tin. This is all stuff from our initial effort to port the sim things. Right now it is coupled to #1557 because this fixes things up in that. Lets merge that one before dealing with this one
This commit is contained in:
@@ -10,16 +10,10 @@ from wpimath.geometry import Rotation2d, Translation3d
|
||||
@pytest.fixture(autouse=True)
|
||||
def scp() -> SimCameraProperties:
|
||||
props = SimCameraProperties()
|
||||
props.setCalibration(1000, 1000, fovDiag=Rotation2d(math.radians(90.0)))
|
||||
props.setCalibrationFromFOV(1000, 1000, fovDiag=Rotation2d(math.radians(90.0)))
|
||||
return props
|
||||
|
||||
|
||||
def test_Constructor() -> None:
|
||||
SimCameraProperties()
|
||||
with pytest.raises(Exception):
|
||||
SimCameraProperties("4774")
|
||||
|
||||
|
||||
def test_GetPixelYaw(scp) -> None:
|
||||
rot = scp.getPixelYaw(scp.getResWidth() / 2)
|
||||
assert rot.degrees() == pytest.approx(0.0, abs=1.0)
|
||||
|
||||
Reference in New Issue
Block a user