Skip to content

ayham-1/trackgen

Repository files navigation

trackgen

example track

Simple track generator for the UMDRacing Driverless Simulation implementation. Not complete, but proof of example works.

Description of Track Format (UMDT)

This is a higher level format for describing a track layout. "Higher level" in the sense that it does not describe individual cone positions.

Overview

All distances are in metres. All angles are in degrees.

Configuration Variables:

List of individual supported track parts:

Special commands:

Each line is a simple csv-like-row. <args> is a list of comma separated arguments. Spaces are considered.

Setting a configuration variable is done like so:

cfg,<name>,<args>

Describing a track section is done like so:

<track_section_name>,<args>

A .umdt file is as follows:

<list_of_configuration_cmds>
<list_of_track_section_cmds>
<list_of_special_cmds>
<list_of_track_section_cmds>

Arguments of each Command

Configuration

distance_between_cones

The distance between every pair of cones along a track

Arguments:

  • d: decimal
cfg,distance_between_cones,5
width_of_track

The distance between every pair of cones.

Arguments:

  • d: decimal
cfg,width_of_track,1.5
allow_overlaps

Allow track sections to overlap.

Arguments:

  • b: boolean
cfg,allow_overlaps,true

Track Sections

start

Represents the start cones of the track. Can only be present once in the track.

Arguments: non

start
end

Represents the end cones of the track. Can only be present once in the track.

Arguments: non

end
straight

A straight stretch along a track

Arguments:

  • d: decimal, the length of the straight stretch.
straight,5
curve

This turn is achieved using BSpline magic (scipy). The curve factor is between 0 and 1, 0 being a straight line, and 1 being a max deviation of half of the distance.

Arguments:

  • direction: string, 'left' or 'right'
  • f: decimal, curve factor
  • d: number, distance of curve
curve,left,0.5,10
turn_left

A hard left 90 degree turn

Arguments: non

turn_left
turn_right

A hard right 90 degree turn

Arguments: non

turn_right
circle

A circle

Arguments:

  • direction: string, 'left' or 'right'
  • radius: decimal, radius of the circle
  • degree: decimal, degree from the circle
circle,left,10,180
hairpin

What commonly known as a 180 turn. (is also secretly used internally for half circles:D)

Arguments:

TODO: radius, direction

non

hairpin
esses

Zigzags thing

Arguments:

  • start_with_left: direction, whether to start by going left or right
  • follow_prev_straight: boolean, whether turn the track so that the zigzag continues on the direction of the previous straight
  • number_of_hcircles: int, number of half circles to create
esses,left,true,5
chicane

A 'Z' like turn with two curves of right and left.

Arguments:

  • d: direction
  • degree1: decimal, degree of first curve
  • distance, decimal, how long the middle section is
  • degree2: decimal, degree of second curve
chicane,left,45,10,45
double_apex_turn

A chicane, but same direction.

Arguments:

  • d: direction
  • distance, decimal, how long the middle section is
double_apex_turn,left,10

Special Commands

overlap

Allows the previous and the next track sections to overlap, useful for making the 8-Track. Must be between two other normal track section.

<track_section_cmd>
overlap
<track_section_cmd>

About

Generates from a track description, geometrical points representing a racing track.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published