Repository navigation
feat(ops243): add internal hardware trigger #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jewbetcha
merged 12 commits into
open-flight:main
from
JPMarhefka:agent/hardware-trigger
Oct 11, 2026
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1aab8eb
feat(ops243): add internal hardware trigger
JPMarhefka c978037
fix(ops243): require tested firmware for hardware trigger
JPMarhefka 05a3aed
feat(ops243): lower hardware trigger magnitude default
JPMarhefka 08d4633
Merge upstream/main before opening hardware-trigger PR
JPMarhefka 30db85d
Revise Raspberry Pi retest checklist for clarity
JPMarhefka 766b3bb
fix(server): isolate sound trigger options
JPMarhefka 60c7846
Merge branch 'main' into agent/hardware-trigger
JPMarhefka 7123973
Merge upstream/main into hardware-trigger PR
JPMarhefka 73eacc7
Harden OPS243 internal trigger startup
JPMarhefka 4c24d4e
Merge origin/main into agent/hardware-trigger
jewbetcha c4715a4
fix(ops243): re-arm internal trigger with PA so it cannot stick idle
jewbetcha 3d3759b
docs(parts): fix internal-trigger anchor broken by the main merge
jewbetcha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # OPS243 Internal Hardware Trigger | ||
|
|
||
| OpenFlight’s `hardware` trigger mode lets the OPS243-A decide when a rolling-buffer capture starts. It is opt-in; the kiosk default remains the existing SEN-14262 sound trigger. | ||
|
|
||
| ## OPS243 firmware prerequisite | ||
|
|
||
| Hardware-trigger mode requires **OPS243-A firmware v1.3.1**, the release used for | ||
| the validation sessions. The driver queries `?V` before sending the internal | ||
| trigger setup commands and fails fast if the reported version is different or | ||
| unavailable. Update the physical OPS243 using the manufacturer’s firmware | ||
| procedure before running `--trigger hardware`; this application does not flash | ||
| the radar. | ||
|
|
||
| ## Methodology | ||
|
|
||
| The host configures the radar once and then waits for the radar’s completed rolling-buffer dump. The host does not poll speed reports or send `S!` for each shot: | ||
|
|
||
| 1. Put the radar in idle mode with `PI`. | ||
| 2. Arm the outbound internal speed threshold with `ST-n` (25 mph by default; | ||
| outbound radar velocity is negative). | ||
| 3. Enter rolling-buffer mode with `GC`. | ||
| 4. Restore the detector settings that `GC` resets: 30 ksps, MPH units, 128 samples, `X=2`, outbound filtering, JSON plus magnitude output, and the configured `S#n` split. | ||
| 5. Restore `ST-n` and the magnitude gate `SMn`, then allow the 4,096-sample history to fill. | ||
| 6. Wait for the board-triggered dump, parse the I/Q payload, and reject it if it has no outbound ball-speed reading at or above 35 mph. | ||
| 7. Re-arm with `GC`, restore the cached settings, and wait for the buffer to fill again. A serial write timeout keeps the capture and reports a retryable re-arm failure instead of discarding the shot. | ||
|
|
||
| The implementation is intentionally limited to the OPS243 trigger path; the | ||
| experimental analysis and UI work remain outside this focused change. | ||
|
|
||
| ## Defaults and command | ||
|
|
||
| | Setting | Hardware-mode default | | ||
| |---|---:| | ||
| | Trigger threshold | 25 mph | | ||
| | Trigger magnitude | 25 (`SM25`) | | ||
| | Pre-trigger split | 6 segments (`S#6`) | | ||
| | Sample rate | 30 ksps (required) | | ||
| | Minimum accepted outbound ball speed | 35 mph | | ||
|
|
||
| Run the mode directly with: | ||
|
|
||
| ```bash | ||
| openflight-server \ | ||
| --trigger hardware \ | ||
| --trigger-threshold 25 \ | ||
| --trigger-magnitude 25 \ | ||
| --pre-trigger-segments 6 \ | ||
| --sample-rate 30 | ||
| ``` | ||
|
|
||
| The kiosk script forwards the same settings: | ||
|
|
||
| ```bash | ||
| scripts/start-kiosk.sh --trigger hardware | ||
| ``` | ||
|
|
||
| Use `--trigger-threshold`, `--trigger-magnitude`, and `--pre-trigger-segments` to override the hardware path. `S#6` applies only to this new mode. The established sound path continues to use `--sound-pre-trigger` and keeps its existing default and behavior: | ||
|
|
||
| ```bash | ||
| scripts/start-kiosk.sh --trigger sound --sound-pre-trigger 16 | ||
| ``` | ||
|
|
||
| The internal trigger does not depend on the SEN-14262 sound edge. Existing sound-trigger wiring can remain installed, but selecting `hardware` is the software choice that activates the OPS243 internal trigger. | ||
|
|
||
| ## Raspberry Pi retest checklist | ||
|
|
||
| Before treating a PR as ready for merge, run the hardware path on the target Pi and record the observations in the PR body: | ||
|
|
||
| Also run the unchanged sound path with the same representative shots: | ||
|
|
||
| ```bash | ||
| scripts/start-kiosk.sh --trigger sound | ||
| ``` | ||
|
|
||
| I was unable to regression test the sound trigger. | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.