Skip to content

Record maximum G on all axes in every session and surface it in Review #137

Description

@PurpleSentinel

Objective

Every session — Track Day and Race, not only G-Only — must record maximum G force on
all axes, and those maxima must be available in Review afterwards.

The design consequence

logger::SessionSummaryV1 has no G-force fields at all:

schema_version, record_size_bytes, session_id, session_duration_ms, session_overrun_ms,
completion_reason, integrity, degraded_subsystems, lap_count, best_lap_index,
best_lap_duration_ns, source_*, logger_*

Adding maxima therefore means a log format schema change, which is the part that
needs designing rather than just coding:

  • Bump kLogFormatVersion and add a SessionSummaryV2
  • Decide whether V1 summaries stay readable. The reader already distinguishes
    SummaryReadResult::unsupported_version, so the machinery exists; the decision is
    whether old sessions remain reviewable or are rejected.
  • record_size_bytes is already carried per record, which should make a
    size-tolerant reader feasible — worth confirming before committing to the approach.
  • Decide which maxima are stored. ui::ImuPeakSummary already tracks acceleration,
    braking, left, right, total, and the position at which total occurred. Storing that
    structure keeps one definition of "peak" across the live meter and the summary.
  • Decide whether vertical G is included. board::ImuSample carries a Z axis but the
    meter is planar today, and kerb strikes make vertical peaks noisy and of
    questionable value.
  • Decide whether the peak is per-session or also per-lap. Per-lap is more useful for
    Race and considerably more data.

Where the peaks come from

ui::ImuMeterController::update_peaks already maintains exactly these maxima and is
host-tested. The session recorder should consume that rather than computing maxima a
second time, or the live radar and the stored summary will eventually disagree.

This must run in Track Day and Race, not only G-Only. In Track Day the meter is not
displayed, but recording continues — the same principle as lap times, which are recorded
throughout and only withheld from the live display.

Scope

  • Extend the session summary with G maxima behind a version bump
  • Feed peaks from ImuMeterController into the session recorder in all modes
  • Surface maxima in SessionReviewController and the review screen
  • Ensure peaks reset per session and cannot leak across sessions
  • Handle an absent or failed IMU by recording maxima as unavailable rather than zero,
    since zero is a legitimate reading and would be indistinguishable
  • Update docs/DATA_LOGGING.md and docs/SESSION_WORKFLOW.md

Acceptance criteria

  • A Track Day session records G maxima and they appear in Review
  • A Race session does the same
  • Maxima match what the live meter showed during the session
  • An absent IMU yields "unavailable", not 0.00 G
  • The version decision for existing summaries is implemented and documented
  • Round-trip is covered by host tests

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:loggingSession logging, export, and replayarea:session-uiSession workflow and driver-facing UIenhancementNew feature or requestpriority:highRequired for the current milestone or a correctness/reliability risk

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions