Home

Awesome

Introduction

This repository contains algorithms that allow us to determine an optimal racing line on a race track. You can chose between several objectives:

The minimum curvature line is quite near to a minimum time line in corners but will differ as soon as the car's acceleration limits are not exploited. However, the minimum time optimization requires a lot more parameters and takes more computation time. Please look into the main_globaltraj.py for all possible options.

List of components

Trajectory Planning Helpers repository

Lots of the required functions for trajectory planning are cumulated in our trajectory planning helpers repository. It can be found on https://github.com/TUMFTM/trajectory_planning_helpers. They can be quite useful for other projects as well.

Dependencies

Use the provided requirements.txt in the root directory of this repo, in order to install all required modules.
pip3 install -r /path/to/requirements.txt

The code is developed with Ubuntu 20.04 LTS and Python 3.7.

Solutions for possible installation problems (Windows)

Solutions for possible installation problems (Ubuntu)

Creating your own friction map

The script main_gen_frictionmap.py can be used to create your own friction map for any race track file supplied in the input folder. The resulting maps are stored in the inputs/frictionmaps folder. These friction maps can be used within the minimum time optimization. In principle, they can also be considered within the velocity profile calculation of the minimum curvature planner. However, this is currently not supported from our side.

Running the code

IMPORTANT: For further information on the minimum time optimization have a look into the according Readme.md which can be found in the opt_mintime_traj folder!

Resulting raceline for the Berlin FE track

Wording and conventions

We tried to keep a consistant wording for the variable names:

Our normal vectors usually point to the right in the direction of driving. Therefore, we get the track boundaries by multiplication as follows: norm_vector * w_tr_right, -norm_vector * w_tr_left.

Trajectory definition

The global racetrajectory optimization currently supports two output formats:

In order to en-/disable the export of any of these files, add the respective entry to the 'file_paths'-dict in the 'main_globtraj.py'-script (search for # assemble export paths). By the default, the file path for the 'LTPL Trajectory' is commented out.

Details about the individual formats are given in the following.

Race Trajectory

The output csv contains the global race trajectory. The array is of size [no_points x 7] where no_points depends on stepsize and track length. The seven columns are structured as follows:

LTPL Trajectory

The output csv contains the source information of the global race trajectory and map information via the normal vectors. The array is of size [no_points x 12] where no_points depends on step size and track length. The seven columns are structured as follows:

The generated file can be directly imported by the graph-based local trajectory planner.

References