Track Pulse NMEA
Overview
GPS lap analysis skill for motorsport track days. Parses raw NMEA 0183 GPS logs, automatically detects laps, and calculates professional racing metrics including braking points, cornering line deviation, G-force analysis, and sector times. Outputs structured JSON ready for LLM analysis and comparison.
Core Capabilities
1. NMEA 0183 Parsing
- Full file or streaming parsing of raw GPS logger output
- Robust error handling - skips corrupted data and continues parsing
- Extracts structured GPS points with coordinates, speed, altitude, and timestamps
2. Automatic Lap Extraction
- Automatic lap detection based on start/finish line coordinates
- Configurable detection threshold
- Handles multiple laps in a single log file
3. Racing Metrics Calculation
- Braking point detection: Identifies where drivers begin braking for each corner
- Cornering line deviation: Compares target lap against reference lap line
- G-force analysis: Longitudinal (acceleration/deceleration) and lateral (cornering) G stats
- Sector time calculation: Split lap into sectors and compare timings
4. JSON Export
- Structured output format with complete comparison data
- Ready for LLM analysis and visualization
Usage Example
Complete end-to-end comparison from two NMEA files:
from scripts import LapComparisonWorkflow
# Define start/finish line coordinates (WGS84 decimal degrees)
START_FINISH_LAT = 31.0777
START_FINISH_LON = 121.1149
# Create workflow instance
workflow = LapComparisonWorkflow(
start_finish_lat=START_FINISH_LAT,
start_finish_lon=START_FINISH_LON,
detection_threshold_m=50.0
)
# Run comparison
result = workflow.compare_from_files(
target_file="my_fast_lap.nmea",
reference_file="reference_best_lap.nmea",
sector_splits=[800, 1650],
corners=[
(31.078, 121.110, 60),
(31.085, 121.102, 50),
],
braking_threshold=3.0,
include_points=False,
include_racing_metrics=True
)
# Export to JSON
json_output = workflow.to_json(result, pretty_print=True)
print(json_output)
Output Schema
The skill outputs structured JSON with:
version: Output format version
target_lap / reference_lap: Basic lap metrics (duration, average speed, max speed)
comparison: Delta comparison (which lap is faster, time difference)
racing_metrics: Detailed metrics including braking points, G-forces, sector times, corner deviations
metadata: File information and configuration
Requirements
pynmea2>=1.19.0 - NMEA parsing library
scripts/
nmea_parser.py: Core NMEA parsing and lap extraction
racing_metrics.py: Racing metrics calculation (braking, G-forces, deviation, sectors)
json_exporter.py: JSON export utilities
lap_comparison.py: High-level workflow entry point
demo_parse.py: Demo parsing example
1---2name: track-pulse-nmea3description: NMEA 0183 GPS log parser and lap comparison analyzer for motorsport track day performance analysis. Provides professional racing metrics calculation structured for LLM consumption. Use when analyzing GPS track data, comparing lap times, extracting racing metrics (braking points, G-forces, cornering deviation), or processing motorsport GPS logs.4---5
6# Track Pulse NMEA
7
8## Overview
9
10GPS lap analysis skill for motorsport track days. Parses raw NMEA 0183 GPS logs, automatically detects laps, and calculates professional racing metrics including braking points, cornering line deviation, G-force analysis, and sector times. Outputs structured JSON ready for LLM analysis and comparison.
11
12## Core Capabilities
13
14### 1. NMEA 0183 Parsing
15- Full file or streaming parsing of raw GPS logger output
16- Robust error handling - skips corrupted data and continues parsing
17- Extracts structured GPS points with coordinates, speed, altitude, and timestamps
18
19### 2. Automatic Lap Extraction
20- Automatic lap detection based on start/finish line coordinates
21- Configurable detection threshold
22- Handles multiple laps in a single log file
23
24### 3. Racing Metrics Calculation
25- **Braking point detection**: Identifies where drivers begin braking for each corner
26- **Cornering line deviation**: Compares target lap against reference lap line
27- **G-force analysis**: Longitudinal (acceleration/deceleration) and lateral (cornering) G stats
28- **Sector time calculation**: Split lap into sectors and compare timings
29
30### 4. JSON Export
31- Structured output format with complete comparison data
32- Ready for LLM analysis and visualization
33
34## Usage Example
35
36### Complete end-to-end comparison from two NMEA files:
37
38```python
39from scripts import LapComparisonWorkflow
40
41# Define start/finish line coordinates (WGS84 decimal degrees)
42START_FINISH_LAT = 31.0777
43START_FINISH_LON = 121.1149
44
45# Create workflow instance
46workflow = LapComparisonWorkflow(
47 start_finish_lat=START_FINISH_LAT,
48 start_finish_lon=START_FINISH_LON,
49 detection_threshold_m=50.0
50)
51
52# Run comparison
53result = workflow.compare_from_files(
54 target_file="my_fast_lap.nmea",
55 reference_file="reference_best_lap.nmea",
56 sector_splits=[800, 1650],
57 corners=[
58 (31.078, 121.110, 60),
59 (31.085, 121.102, 50),
60 ],
61 braking_threshold=3.0,
62 include_points=False,
63 include_racing_metrics=True
64)
65
66# Export to JSON
67json_output = workflow.to_json(result, pretty_print=True)
68print(json_output)
69```
70
71## Output Schema
72
73The skill outputs structured JSON with:
74- `version`: Output format version
75- `target_lap` / `reference_lap`: Basic lap metrics (duration, average speed, max speed)
76- `comparison`: Delta comparison (which lap is faster, time difference)
77- `racing_metrics`: Detailed metrics including braking points, G-forces, sector times, corner deviations
78- `metadata`: File information and configuration
79
80## Requirements
81
82- `pynmea2>=1.19.0` - NMEA parsing library
83
84## scripts/
85
86- `nmea_parser.py`: Core NMEA parsing and lap extraction
87- `racing_metrics.py`: Racing metrics calculation (braking, G-forces, deviation, sectors)
88- `json_exporter.py`: JSON export utilities
89- `lap_comparison.py`: High-level workflow entry point
90- `demo_parse.py`: Demo parsing example