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:
Lucien Morey
2024-11-15 09:59:55 +11:00
committed by GitHub
parent 4dc4ae88de
commit dfed7e3621
6 changed files with 158 additions and 192 deletions

View File

@@ -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)