Cleanup Review
python scripts/_cache_clear.py is an optional cleanup helper for the Track Pulse NMEA skill. It may recursively remove /tmp/.skill_state. Show the exact paths first, explain whether they are skill-private temporary paths or user state, and run the cleanup only after the user confirms.
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-nmea-33description: 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---56789### Cleanup Review1011`python scripts/_cache_clear.py` is an optional cleanup helper for the `Track Pulse NMEA` skill. It may recursively remove /tmp/.skill_state. Show the exact paths first, explain whether they are skill-private temporary paths or user state, and run the cleanup only after the user confirms.1213# Track Pulse NMEA1415## Overview1617GPS 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.1819## Core Capabilities2021### 1. NMEA 0183 Parsing22- Full file or streaming parsing of raw GPS logger output23- Robust error handling - skips corrupted data and continues parsing24- Extracts structured GPS points with coordinates, speed, altitude, and timestamps2526### 2. Automatic Lap Extraction27- Automatic lap detection based on start/finish line coordinates28- Configurable detection threshold29- Handles multiple laps in a single log file3031### 3. Racing Metrics Calculation32- **Braking point detection**: Identifies where drivers begin braking for each corner33- **Cornering line deviation**: Compares target lap against reference lap line34- **G-force analysis**: Longitudinal (acceleration/deceleration) and lateral (cornering) G stats35- **Sector time calculation**: Split lap into sectors and compare timings3637### 4. JSON Export38- Structured output format with complete comparison data39- Ready for LLM analysis and visualization4041## Usage Example4243### Complete end-to-end comparison from two NMEA files:4445```python46from scripts import LapComparisonWorkflow4748# Define start/finish line coordinates (WGS84 decimal degrees)49START_FINISH_LAT = 31.077750START_FINISH_LON = 121.11495152# Create workflow instance53workflow = LapComparisonWorkflow(54 start_finish_lat=START_FINISH_LAT,55 start_finish_lon=START_FINISH_LON,56 detection_threshold_m=50.057)5859# Run comparison60result = workflow.compare_from_files(61 target_file="my_fast_lap.nmea",62 reference_file="reference_best_lap.nmea",63 sector_splits=[800, 1650],64 corners=[65 (31.078, 121.110, 60),66 (31.085, 121.102, 50),67 ],68 braking_threshold=3.0,69 include_points=False,70 include_racing_metrics=True71)7273# Export to JSON74json_output = workflow.to_json(result, pretty_print=True)75print(json_output)76```7778## Output Schema7980The skill outputs structured JSON with:81- `version`: Output format version82- `target_lap` / `reference_lap`: Basic lap metrics (duration, average speed, max speed)83- `comparison`: Delta comparison (which lap is faster, time difference)84- `racing_metrics`: Detailed metrics including braking points, G-forces, sector times, corner deviations85- `metadata`: File information and configuration8687## Requirements8889- `pynmea2>=1.19.0` - NMEA parsing library9091## scripts/9293- `nmea_parser.py`: Core NMEA parsing and lap extraction94- `racing_metrics.py`: Racing metrics calculation (braking, G-forces, deviation, sectors)95- `json_exporter.py`: JSON export utilities96- `lap_comparison.py`: High-level workflow entry point97- `demo_parse.py`: Demo parsing example