Collapse two-axis IDR into a single dual-axis instance#429
Open
brickbots wants to merge 2 commits into
Open
Conversation
End-to-end adoption of the dataclasses in PiFinder/types/positioning.py: - Solver builds a fresh PointingEstimate per attempt and pushes to solver_queue. Alignment queue carries AlignOnRaDec / AlignCancel / ReloadSqmCalibration commands and AlignedResult responses, dispatched via isinstance(). - Integrator owns the long-lived PointingEstimate. solve cells survive failed plate-solves so IMU dead-reckoning keeps producing aligned estimates. - shared_state.solution() / set_solution() carry PointingEstimate; default to an empty PointingEstimate() so consumers can always call .has_pointing() without a None check. - All ~15 consumers (UI, server, pos_server, nearby, etc.) read via the PointingEstimate access shape (pointing.aligned.estimate.RA, etc.). - solve_pixel -> target_pixel rename: code, default_config.json, shared_state.target_pixel() / set_target_pixel(), Config key. No user-config migration logic; users re-align to write the new key. - Delete solver_main.py (dead code), get_initialized_solved_dict(), to_legacy_dict() / from_legacy_dict() bridge methods, and the "PROPOSAL ONLY" framing in types/positioning.py. - Add matched_centroids / matched_stars fields to PointingEstimate so the SQM calibration UI can replay SQM calculations from cached published solutions. - Pull the simplified ImuDeadReckoning (and legacy companion + tests) from idr_tests so the integrator's IDR call surface matches. - 21 new unit tests in test_pointing_estimate.py covering dataclass basics, solver builders, integrator merge semantics, failed-solve anchor preservation, alignment dispatch, picklability, deep-copy isolation. - CONTEXT.md cleaned of stale migration notes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ImuDeadReckoning now handles both camera and aligned axes in one instance. solve() takes (camera, aligned, q_x2imu) and captures q_cam2aligned alongside q_eq2x; predict() composes the camera prediction with q_cam2aligned and returns both as a tuple. The integrator drops the idr_camera/idr_aligned pair for a single idr. The IDR remains a math primitive (RaDecRoll in, tuple of RaDecRoll out) and does not import from PiFinder.types.positioning. Equivalence tests now parametrize over (screen_direction, alignment_offset) and check both predicted.camera == legacy.cam and predicted.aligned == legacy.scope for identity and real-offset cases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ImuDeadReckoningnow handles both camera and aligned axes in one instance.solve()takes(camera, aligned, q_x2imu)and capturesq_cam2alignedalongsideq_eq2x;predict()composes the camera prediction withq_cam2alignedand returns both as a(camera, aligned)tuple.reset()clears both quaternions.integrator.pydrops theidr_camera/idr_alignedpair for a singleidr. Both call sites (_apply_successful_solve,_advance_with_imu) collapse to one IDR call.RaDecRollin,RaDecRollout. No import fromPiFinder.types.positioning.(screen_direction, alignment_offset ∈ {identity, real_offset})and assert bothpredicted.camera == legacy.get_cam_radec()andpredicted.aligned == legacy.get_scope_radec().imu_dead_reckoning_legacy.pystays in the tree until the user is comfortable removing it in a follow-up.Builds on #428 (the prior
solveddict →PointingEstimatemigration on the same branch).Test plan
nox -s lint type_hints smoke_tests unit_tests— all green (213 unit tests pass).pointing.aligned.estimatereflects it.🤖 Generated with Claude Code