Skip to content

vader-droid33/f1tenth_lap_timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

f1tenth_lap_timer

Detect lap completions and record lap times from TUM trajectory files. Works with any SLAM algorithm output or MoCap ground truth no ROS2 required.

Layout 01  Hairpins

Layout 00  Oval

Example 1  Layout 01 Hairpins

Example 2  Layout 00 Oval

Features

  • Automatic finish line detection (uses start position by default)
  • Custom finish line position and zone radius
  • Lap time, distance, and average speed per lap
  • Best/worst/average lap statistics
  • Trajectory map with lap segments coloured by lap number
  • Lap time bar chart with best lap marker
  • CSV export
  • Works with any TUM trajectory file

Installation

git clone https://github.com/vader-droid33/f1tenth_lap_timer.git
cd f1tenth_lap_timer
pip install -e .

Usage

# Basic lap detection
f1tenth_lap_timer trajectory.tum

# With plot
f1tenth_lap_timer trajectory.tum --plot

# Custom finish line
f1tenth_lap_timer trajectory.tum --finish-line 1.5 0.5 --radius 0.4

# Export lap times
f1tenth_lap_timer trajectory.tum --export laps.csv

# Save plot
f1tenth_lap_timer trajectory.tum --plot --save laps.png --no-show

Python API

from f1tenth_lap_timer import load_tum, detect_finish_line, compute_trajectory_stats

timestamps, xyz = load_tum("trajectory.tum")
laps = detect_finish_line(xyz, timestamps, finish_point=[0, 0], radius=0.3)

for lap in laps:
    print(f"Lap {lap['lap']}: {lap['duration']:.3f}s")

License

MIT

About

Detect lap completions and record lap times from TUM trajectory files - works with any SLAM output or MoCap ground truth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages