Phase B4: fuse mobile GPS/IMU into camera calibration - #12
Closed
mandarwagh9 wants to merge 1 commit into
Closed
mandarwagh9 wants to merge 1 commit into
mandarwagh9 wants to merge 1 commit into
Conversation
Phase B4. The mobile client streams GPS (watchPosition) + IMU (DeviceOrientationEvent), but the backend was receiving and discarding the sensor_data message. Now it's fused. - New app/infrastructure/geo.py: gps_to_local() equirectangular projection. - World model: update_camera_sensor() converts GPS -> local position (relative to GPS_REFERENCE_* or the first fix as origin) and DeviceOrientation alpha/beta/gamma -> camera rotation, overriding the auto-default calibration. Added to the WorldModelRepository port (concrete no-op default). - main.py: /ws/camera handler forwards sensor_data to the world model instead of pass. - README: flip GPS/IMU fusion from planned to implemented. - Tests: 8 new (geo: origin/north/east projection; fusion: first-fix origin, north offset, configured reference, orientation->rotation, no-data no-op). Coverage 58%->59%. ruff/mypy clean, 103 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Superseded — all commits from this phase landed on |
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.
What & why
Phase B4. The mobile client streams GPS (
watchPosition) + IMU (DeviceOrientationEvent), but the backend was receiving and discarding thesensor_datamessage (pass). Now it's fused into the camera calibration.Changes
app/infrastructure/geo.py—gps_to_local(): equirectangular projection of lat/lng to local east/north metres.update_camera_sensor()— GPS → local position (relative toGPS_REFERENCE_*, or the first fix becomes the origin) andDeviceOrientationalpha/beta/gamma → camera rotation (roll/pitch/yaw). Overrides the auto-default calibration for that camera; missing fields fall back to any existing calibration. Added to theWorldModelRepositoryport as a concrete no-op default.main.py— the/ws/camerahandler now forwardssensor_datato the world model instead of discarding it (verified the fused keys match whatcameraStreamAdapter.jsactually sends).Tests (TDD)
8 new:
test_geo.py— reference→origin, north offset → +y (~111 m), east offset → +x scaled by cos(lat)test_gps_fusion.py— first fix becomes origin, second fix north → +y, configured reference used, orientation → rotation (yaw), no-data → no-opVerification
ruffclean ·mypyclean (18 files) · 103 tests pass (was 95).🤖 Generated with Claude Code