From c08ac2798eb1e5924d9388ba83ab464839a75114 Mon Sep 17 00:00:00 2001 From: Mike Rosseel Date: Mon, 2 Mar 2026 22:48:53 +0100 Subject: [PATCH] fix: handle quaternion type in serialize_solution The imu_quat field in the solution dict contains a quaternion object that is not JSON serializable, causing a crash when logging observations. Co-Authored-By: Claude Opus 4.6 --- python/PiFinder/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/PiFinder/utils.py b/python/PiFinder/utils.py index e864bff2e..523228537 100644 --- a/python/PiFinder/utils.py +++ b/python/PiFinder/utils.py @@ -39,6 +39,10 @@ def serialize_solution(solution: dict) -> str: if "numpy.float" in str(type(v)): v = float(v) + + if "quaternion" in str(type(v)): + v = v.components.tolist() + out_dict[k] = v return json.dumps(out_dict)