Skip to content

fix: handle quaternion type in serialize_solution#389

Merged
brickbots merged 1 commit intobrickbots:mainfrom
mrosseel:fix/quaternion-serialization
Mar 4, 2026
Merged

fix: handle quaternion type in serialize_solution#389
brickbots merged 1 commit intobrickbots:mainfrom
mrosseel:fix/quaternion-serialization

Conversation

@mrosseel
Copy link
Collaborator

@mrosseel mrosseel commented Mar 2, 2026

Summary

  • serialize_solution() crashes with TypeError: Object of type quaternion is not JSON serializable when logging an observation
  • The imu_quat field added in IMU Integrator Selection + Misc Adjustments  #388 contains a quaternion object that json.dumps can't handle
  • Added quaternion-to-list conversion, consistent with existing uint16 and numpy.float handling

Test plan

  • Log an observation on a device with IMU connected and verify no crash
  • Verify the stored solution JSON contains the quaternion as a list of 4 floats

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@mrosseel mrosseel force-pushed the fix/quaternion-serialization branch from f8aaf59 to c08ac27 Compare March 2, 2026 21:54
@brickbots brickbots merged commit 03c75d5 into brickbots:main Mar 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants