Skip to main content

Generate random Formula Student Driverless race tracks.

Project description

Random Track Generator

Python License

Generate random, rules-compliant tracks for Formula Student Driverless competitions. Creates realistic tracks with proper track width, cone spacing, and corner radii using Voronoi diagram-based generation.

Developed by Formula Student Team Delft for use with FSSIM and FSDS.

How It Works

Tracks are generated using bounded Voronoi diagrams from uniformly sampled points. Regions are selected using one of three modes (Expand, Extend, or Random), then interpolated with cubic splines to create smooth, realistic racing lines.

Installation

pip install random-track-generator

Usage

Generate a random track

from random_track_generator import generate_track

# Use preset parameters
track = generate_track("small")
track = generate_track("medium")
track = generate_track("large", seed=42)

# Or set parameters manually
track = generate_track(
    n_points=60,       # Voronoi points
    n_regions=20,      # Regions to select
    min_bound=0.,      # Minimum x/y bound [m]
    max_bound=150.,    # Maximum x/y bound [m]
    mode="extend",     # Generation mode
    seed=42            # Optional: for reproducibility
)

cones_left, cones_right = track.as_tuple()

Generation Modes

  • "expand" - Selects nearest neighbors for roundish tracks
  • "extend" - Selects regions along a random line for elongated tracks
  • "random" - Randomly selects regions for large, irregular tracks

Note: Not all parameter combinations produce stable results. Experiment with settings if generation fails.

Load a preset track

from random_track_generator import load_track

track = load_track("FSG")                       # FSG and FSI available
cones_left, cones_right = track.as_tuple()

Save to file

track.save("output/", sim_type="fssim")         # YAML for FSSIM
track.save("output/", sim_type="fsds")          # CSV for FSDS
track.save("output/", sim_type="gpx", 
           lat_offset=51.19, lon_offset=5.32)   # GPX with coordinates

Credits

Based on Ian Hudson's Race-Track-Generator.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

random_track_generator-1.1.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

random_track_generator-1.1.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file random_track_generator-1.1.0.tar.gz.

File metadata

  • Download URL: random_track_generator-1.1.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for random_track_generator-1.1.0.tar.gz
Algorithm Hash digest
SHA256 fb056aff1f56c12eff7a52f3de4073bbb76e9ad063f07ad1668da78318d931f1
MD5 778e46af63ec9ad8dbfa2ffb28029fa5
BLAKE2b-256 e4be79f54a19f77239911bde6c088080c81a0340e4f4b80e3cc2b056e95d076c

See more details on using hashes here.

Provenance

The following attestation bundles were made for random_track_generator-1.1.0.tar.gz:

Publisher: python-publish.yml on mvanlobensels/random-track-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file random_track_generator-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for random_track_generator-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 655221abc3ffc8b98cf4944ea970ec7d5e12a5d51dcd48475a41b59a0624ebd7
MD5 0f3779dd57ab739b2e024a8b6a4412f9
BLAKE2b-256 65e2a14eda8a8fcd10ca369f455398093e65f9b2614749d2ebb55bd0823c54c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for random_track_generator-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on mvanlobensels/random-track-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page