Updated requirements.txt
Added timing logic
Responsivness fixes
All NMEA sentences should be reporting times in UTC, but they seem to be shifted by a weird offset from the actual time. Since most time calculations are relative (how long was this race, how longs was this leg, etc.) in practice it doesn't make a huge difference. The JS side of the code uses timestamps in UTC milliseconds since the UNIX epoch.
The following algorithm is used to approximate the start line:
To determine the start time:
To determine the end time:
Using this and calculating the total time of the 2022-08-03 race yielded a result within 10 s of the result reported by the race committee.
Once the boat is within BUOY_THRESHOLD (0.05 nm) of a mark, the absolute change in heading between points (mod 180) is monitored. Once a change in heading is greater than TURN_THRESHOLD (20 degrees) the boat is considered to be rounding a mark. Once the change in heading is less than TURN_THRESHOLD the boat is considered to be done rounding a mark.
Rounding times and leg times are shown in the analysis output.