Skip to content

Fix launch detection and cancellation - #16

Merged
PurpleSentinel merged 1 commit into
v3from
feature/issue-3-launch-detection
Aug 9, 2026
Merged

Fix launch detection and cancellation#16
PurpleSentinel merged 1 commit into
v3from
feature/issue-3-launch-detection

Conversation

@PurpleSentinel

Copy link
Copy Markdown
Contributor

Summary

  • replace the impossible all-axis launch threshold with a calibrated acceleration-vector delta
  • remove gravity and mounting orientation through a 0.4-second stationary baseline
  • filter and debounce the signal to reject isolated vibration while handling either acceleration direction
  • add double-tap cancellation and a 30-second safe timeout
  • document sensitivity values in g and their practical meaning

Root cause

The previous loop required all three signed acceleration axes to exceed the configured threshold simultaneously. A real vehicle launch normally affects one principal axis while gravity and the other axes can remain below zero, so Launch Mode could wait forever and offered no escape path.

Validation

  • python3 -m unittest discover -s tests -v — 41 tests passed
  • deterministic stationary, forward-launch, reverse-axis, vibration, cancellation, and timeout cases passed
  • connected QMI8658 stationary sampling measured approximately 0.003 g peak-to-peak noise
  • MicroPython hardware tests confirmed positive and negative launch detection, ±2 g vibration rejection, real stationary timeout, and cancellation
  • connected CST816T integration confirmed the double-tap callback exits and clears the gesture

Fixes #3

@PurpleSentinel
PurpleSentinel merged commit 1a6ebc8 into v3 Aug 9, 2026
2 checks passed
@PurpleSentinel
PurpleSentinel deleted the feature/issue-3-launch-detection branch August 9, 2026 21:54
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.

Make launch detection trigger on meaningful acceleration and remain cancellable

2 participants