add missing log and use logger over print (#1596)

This is closer to a port of the Java/C++ stuff and will mean we get a
more standard print output with the rest of the logging in the lib
This commit is contained in:
Lucien Morey
2024-11-21 14:01:08 +11:00
committed by GitHub
parent adb18fe711
commit c536a1c312
2 changed files with 8 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ from wpimath.units import hertz, seconds
from ..estimation import RotTrlTransform3d
logger = logging.getLogger(__name__)
class SimCameraProperties:
"""Calibration and performance values for this camera.
@@ -46,7 +48,7 @@ class SimCameraProperties:
) -> None:
if fovDiag.degrees() < 1.0 or fovDiag.degrees() > 179.0:
fovDiag = Rotation2d.fromDegrees(max(min(fovDiag.degrees(), 179.0), 1.0))
logging.error("Requested invalid FOV! Clamping between (1, 179) degrees...")
logger.error("Requested invalid FOV! Clamping between (1, 179) degrees...")
resDiag = math.sqrt(width * width + height * height)
diagRatio = math.tan(fovDiag.radians() / 2.0)