Feat/live camera shot analysis - #290
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The standalone analysis flag cannot perform analysis without IWR6843, and its current bounds exclude normal driver shots.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Adds opt-in live camera shot analysis to the capture pipeline.
Changes:
- Adds impact-aware ball detection and horizontal-launch fitting.
- Shares camera anchors and records analysis timing.
- Improves simulator disconnect diagnostics.
| File | Description |
|---|---|
src/openflight/camera/ball_flight.py |
Adds horizontal-launch estimator |
src/openflight/camera/club_motion.py |
Adds impact-aware detection |
src/openflight/camera/club_delivery.py |
Reuses impact detection and anchors |
src/openflight/server.py |
Wires analysis mode and timing |
src/openflight/sim/transport.py |
Reports disconnect reasons |
scripts/start-kiosk.sh |
Recognizes the new camera mode |
tests/test_camera_ball_flight.py |
Tests horizontal estimation |
tests/test_camera_club_motion.py |
Tests impact-aware detection |
tests/test_server.py |
Tests fusion and timing wiring |
tests/test_sim_server_wiring.py |
Tests reconnect logging |
tests/test_sim_transport.py |
Tests disconnect reasons |
tests/test_start_kiosk.py |
Tests kiosk argument handling |
tests/test_startup_status.py |
Tests camera startup status |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4359
to
+4364
| "--camera-shot-analysis", | ||
| action="store_true", | ||
| help=( | ||
| "Enable camera capture with experimental impact-aware ball and club analysis " | ||
| "instead of the legacy camera analyzer" | ||
| ), |
Comment on lines
+545
to
+548
| if vertical_deg is None or not 18.0 <= vertical_deg <= 55.0: | ||
| return CameraBallEstimate("withheld_vertical_out_of_bounds") | ||
| if ops_ball_speed_mph is None or not 35.0 <= ops_ball_speed_mph <= 130.0: | ||
| return CameraBallEstimate("withheld_ball_speed_out_of_bounds") |
Comment on lines
+4359
to
+4364
| "--camera-shot-analysis", | ||
| action="store_true", | ||
| help=( | ||
| "Enable camera capture with experimental impact-aware ball and club analysis " | ||
| "instead of the legacy camera analyzer" | ||
| ), |
| ever_connected = True | ||
| self._set_state(ConnectionState.CONNECTED) | ||
| self._recv_loop() | ||
| reconnect_reason = self._recv_loop() |
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.



This uses some basic OpenCV to supplement club path and horizontal angle metrics. Completely opt-in for now