mirror of
https://github.com/IAmTomShaw/f1-race-replay.git
synced 2026-05-09 08:25:56 +02:00
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/f1-race-replay#142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/100
Author: @heytt-satra
Created: 12/21/2025
Status: ✅ Merged
Merged: 12/21/2025
Merged by: @IAmTomShaw
Base:
main← Head:fix/leaderboard-start-pos📝 Commits (1)
7baef98Fix leaderboard incorrect positions at race start (Fixes #63)📊 Changes
1 file changed (+9 additions, -0 deletions)
View changed files
📝
src/interfaces/race_replay.py(+9 -0)📄 Description
Problem Description
The leaderboard was showing incorrect driver positions at the start of the race. Drivers on the grid (physically behind the start line) were being projected to the end of the lap (e.g., 4990m on a 5000m track) because the track projection logic treats the track as a closed loop. This caused backmarkers on the grid to appear as having completed nearly a full lap (Progress: 4990m) compared to the leader who had just crossed the start line (Progress: 10m).
Verification Results
Logic Check
Scenario 1: Car on Grid (Lap 1)
telemetry_dist: 0m (or close to 0)
projected_m: 4950m (Track Length: 5000m)
Old Result: progress_m = 4950m. (Incorrectly viewed as ahead of leader)
New Result: telemetry_dist (0) < 2500m AND projected_m (4950) > 2500m. Condition Met.
projected_m becomes 4950 - 5000 = -50m.
progress_m = -50m. (Correctly viewed as behind leader)
Scenario 2: Car crossed start line (Lap 1)
telemetry_dist: 10m
projected_m: 10m
New Result: Condition projected_m (10) > 2500m is False.
progress_m = 10m.
Scenario 3: End of Lap 1 (Approaching finish)
telemetry_dist: 4950m
projected_m: 4950m
New Result: Condition telemetry_dist (4950) < 2500m is False.
progress_m = 4950m. (Correct)
Automated Tests
Ran python -m py_compile to verify syntax correctness.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.