diff --git a/setup.cfg b/setup.cfg index af90637..55b9c7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ install_requires = av beaupy numpy>=1.20 - pl-neon-recording + pl-neon-recording>=0.1.4 pydantic>=2 websockets zeroconf diff --git a/src/pupil_labs/realtime_api/device.py b/src/pupil_labs/realtime_api/device.py index e3a20a5..c0093c4 100644 --- a/src/pupil_labs/realtime_api/device.py +++ b/src/pupil_labs/realtime_api/device.py @@ -8,6 +8,7 @@ import aiohttp import numpy as np import websockets +from pupil_labs.neon_recording.calib import Calibration import pupil_labs # noqa: F401 @@ -277,25 +278,7 @@ async def get_calibration(self) -> np.ndarray: raise DeviceError(response.status, "Failed to fetch calibration") raw_data = await response.read() - return np.frombuffer( - raw_data, - np.dtype( - [ - ("version", "u1"), - ("serial", "6a"), - ("scene_camera_matrix", "(3,3)d"), - ("scene_distortion_coefficients", "8d"), - ("scene_extrinsics_affine_matrix", "(4,4)d"), - ("right_camera_matrix", "(3,3)d"), - ("right_distortion_coefficients", "8d"), - ("right_extrinsics_affine_matrix", "(4,4)d"), - ("left_camera_matrix", "(3,3)d"), - ("left_distortion_coefficients", "8d"), - ("left_extrinsics_affine_matrix", "(4,4)d"), - ("crc", "u4"), - ] - ), - ) + return Calibration.from_buffer(raw_data) class StatusUpdateNotifier: