Session Analysis Pipeline¶
The analysis pipeline runs entirely client-side. No telemetry data leaves the desktop. When the user selects a reference lap and a current lap, the pipeline automatically fires.
Session Analysis¶
User selects reference lap + current lap
→ AnalysisPipeline detects selection change
→ AnalysisEngine.Analyze(session, refLap, currentLap)
→ TrackSegmentation.BuildSegments(refLap)
→ LapResampler.Resample(refLap, currentLap)
→ Corner-by-corner insight detection
→ AnalysisState.SetResult(result)
→ Compare tab: ranked insights list
→ Telemetry tab: ScottPlot (Speed, Throttle, Brake, Delta)
→ Segments tab: per-corner speed/brake/throttle table
SimCopilot.Core¶
The analysis engine. Zero external dependencies — no UI, no disk, no network.
Key types:
-
TelemetryPoint— immutable data unit, keyed by track distance. Fields: Distance (m), Time (s), Speed (km/h), Throttle/Brake (0–1), Steering (°), Gear, X/Y world position, optional game-specific extras. -
Lap— ordered sequence ofTelemetryPointobjects plus metadata (lap time, validity flag, penalty count, lap time source).LapLengthMetersis taken from the last point's distance. -
SessionData— container holding all laps for a session plusTelemetrySessionMetadata(track, vehicle, weather, recorded timestamp).BestValidLapreturns the fastest valid, timing-eligible lap. -
AnalysisEngine— staticAnalyze(session, refLap, currentLap, options). Compares two laps corner-by-corner after resampling and detects: brake too early, slow corner exit, late throttle application, sector delta loss/gain, lap time variance, throttle input stability. Returns anAnalysisResultwith rankedAnalysisInsight[],TrackSegment[], and the fullResampledLapComparisonfor plotting. -
LapResampler— staticResample(refLap, currentLap, options). Interpolates both laps to N distance points (default 512), computes cumulative time along distance, produces point-wise Δ (current − reference). TheResampledLapComparisonfeeds all four ScottPlot curves (Speed, Throttle, Brake, Delta). -
TrackSegmentation— staticBuildSegments(lap, options). Two-threshold hysteresis on smoothed steering angle to detect corners. Output:TrackSegment[]with kind (Corner/Straight), ordinal, and distance bounds. Used by AnalysisEngine and the Segments tab. -
AnalysisOptions— tunable parameters: sample count, steering thresholds, brake timing tolerance, minimum speed for delta accumulation.