Skip to content

Commit

Permalink
Merge pull request #65 from domstoppable/recording_api_calib
Browse files Browse the repository at this point in the history
use pl-neon-recording for calibration parsing
  • Loading branch information
dourvaris authored Aug 19, 2024
2 parents 4f9b0e0 + d278b6a commit 0a1780c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install_requires =
av
beaupy
numpy>=1.20
pl-neon-recording
pl-neon-recording>=0.1.4
pydantic>=2
websockets
zeroconf
Expand Down
21 changes: 2 additions & 19 deletions src/pupil_labs/realtime_api/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0a1780c

Please sign in to comment.