• Stars
    star
    457
  • Rank 95,775 (Top 2 %)
  • Language
    Python
  • License
    GNU Lesser Genera...
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This repository contains multiple approaches for generating global racetrajectories.

Introduction

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

  • Shortest path
  • Minimum curvature (with or without iterative call)
  • Minimum time
  • Minimum time with powertrain behavior consideration

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

  • frictionmap: This package contains the functions related to the creation and handling of friction maps along the race track.

  • helper_funcs_glob: This package contains some helper functions used in several other functions when calculating the global race trajectory.

  • inputs: This folder contains the vehicle dynamics information, the reference track csvs and friction maps.

  • opt_mintime_traj: This package contains the functions required to find the time-optimal trajectory.

    It also includes the powertrain components in opt_mintime_traj/powertrain_src used to calculate power losses and thermal behavior of the powertrain and to consider the state of charge of the battery.

  • params: This folder contains a parameter file with optimization and vehicle parameters.

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)

  • cvxpy, cython or any other package requires a Visual C++ compiler -> Download the build tools for Visual Studio 2019 (https://visualstudio.microsoft.com/de/downloads/ -> tools for Visual Studio 2019 -> build tools), install them and chose the C++ build tools option to install the required C++ compiler and its dependencies
  • Problems with quadprog -> reason currently not clear, test using quadprog in version 0.1.6 instead 0.1.7

Solutions for possible installation problems (Ubuntu)

  • matplotlib requires tkinter -> can be solved by sudo apt install python3-tk
  • Python.h required quadprog -> can be solved by sudo apt install python3-dev

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

  • Step 1: (optional) Adjust the parameter file that can be found in the params folder (required file).
  • Step 2: (optional) Adjust the ggv diagram and ax_max_machines file in inputs/veh_dyn_info (if used). This acceleration should be calculated without drag resistance, i.e. simply by F_x_drivetrain / m_veh!
  • Step 3: (optional) Add your own reference track file in inputs/tracks (required file).
  • Step 4: (optional) Add your own friction map files in inputs/frictionmaps (if used).
  • Step 5: (optional) If you want to consider the powertrain behavior (thermal behavior, power loss, state of charge), enable the powertrain-option in the parameter file (/params) and adjust the powertrain parameters as needed. Set the number of race laps in the dict imp_opts in main_globaltraj.py and specify a non-regular discretization step length for faster optimization in the parameter file (/params) (if used). You can select a simple approximation of the powertrain components by setting /params/racecar.ini:simple_loss = True or consider more detailed models by specifying /params/racecar.ini:simple_loss = False.
  • Step 6: Adjust the parameters in the upper part of main_globaltraj.py and execute it to start the trajectory generation process. The calculated race trajectory is stored in outputs/traj_race_cl.csv.

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:

  • path -> [x, y] Describes any array containing x,y coordinates of points (i.e. point coordinates).\
  • refline -> [x, y] A path that is used as reference line during our calculations.\
  • reftrack -> [x, y, w_tr_right, w_tr_left] An array that contains not only the reference line information but also right and left track widths. In our case it contains the race track that is used as a basis for the raceline optimization.

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:

  • Race Trajectory - (default) holds detailed information about the race trajectory.
  • LTPL Trajectory - holds source information about the race trajectory as well as information about the track bounds and tue reference line (the actual race trajectory has to be calculated based on the stored information).

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:

  • s_m: float32, meter. Curvi-linear distance along the raceline.
  • x_m: float32, meter. X-coordinate of raceline point.
  • y_m: float32, meter. Y-coordinate of raceline point.
  • psi_rad: float32, rad. Heading of raceline in current point from -pi to +pi rad. Zero is north (along y-axis).
  • kappa_radpm: float32, rad/meter. Curvature of raceline in current point.
  • vx_mps: float32, meter/second. Target velocity in current point.
  • ax_mps2: float32, meter/second². Target acceleration in current point. We assume this acceleration to be constant from current point until next point.

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:

  • x_ref_m: float32, meter. X-coordinate of reference line point (e.g. center line of the track).
  • y_ref_m: float32, meter. Y-coordinate of reference line point (e.g. center line of the track).
  • width_right_m: float32, meter. Distance between reference line point and right track bound (along normal vector).
  • width_left_m: float32, meter. Distance between reference line point and left track bound (along normal vector).
  • x_normvec_m: float32, meter. X-coordinate of the normalized normal vector based on the reference line point.
  • y_normvec_m: float32, meter. Y-coordinate of the normalized normal vector based on the reference line point.
  • alpha_m: float32, meter. Solution of the opt. problem holding the lateral shift in m for the reference line point.
  • s_racetraj_m: float32, meter. Curvi-linear distance along the race line.
  • psi_racetraj_rad: float32, rad. Heading of raceline in current point from -pi to +pi rad. Zero is north.
  • kappa_racetraj_radpm: float32, rad/meter. Curvature of raceline in current point.
  • vx_racetraj_mps: float32, meter/second. Target velocity in current point.
  • ax_racetraj_mps2: float32, meter/second². Target acceleration in current point. We assume this acceleration to be constant from current point until next point.

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

References

  • Minimum Curvature Trajectory Planning
    Heilmeier, Wischnewski, Hermansdorfer, Betz, Lienkamp, Lohmann
    Minimum Curvature Trajectory Planning and Control for an Autonomous Racecar
    DOI: 10.1080/00423114.2019.1631455
    Contact person: Alexander Heilmeier.

  • Time-Optimal Trajectory Planning
    Christ, Wischnewski, Heilmeier, Lohmann
    Time-Optimal Trajectory Planning for a Race Car Considering Variable Tire-Road Friction Coefficients
    DOI: 10.1080/00423114.2019.1704804
    Contact person: Fabian Christ.

  • Friction Map Generation
    Hermansdorfer, Betz, Lienkamp
    A Concept for Estimation and Prediction of the Tire-Road Friction Potential for an Autonomous Racecar
    DOI: 10.1109/ITSC.2019.8917024
    Contact person: Leonhard Hermansdorfer.

  • Powertrain Behavior
    Herrmann, Passigato, Betz, Lienkamp
    Minimum Race-Time Planning-Strategy for an Autonomous Electric Racecar
    DOI: 10.1109/ITSC45102.2020.9294681
    Preprint: https://arxiv.org/abs/2005.07127
    Contact person: Thomas Herrmann.

More Repositories

1

CameraRadarFusionNet

Python
393
star
2

ORB_SLAM3_RGBL

RGB-L: An Extension to Integrate LiDAR Data into ORB-SLAM3
C++
245
star
3

orbslam-map-saving-extension

C++
236
star
4

GraphBasedLocalTrajectoryPlanner

Local trajectory planner based on a multilayer graph framework for autonomous race vehicles.
Python
228
star
5

mod_vehicle_dynamics_control

TUM Roborace Team Software Stack - Path tracking control, velocity control, curvature control and state estimation.
MATLAB
215
star
6

racetrack-database

This repository contains center lines (x- and y-coordinates), track widths and race lines for over 20 race tracks (F1 and DTM) all over the world
171
star
7

EthicalTrajectoryPlanning

An Ethical Trajectory Planning Algorithm for Autonomous Vehicles
Python
143
star
8

trajectory_planning_helpers

Useful functions used for path and trajectory planning at TUM/FTM
Python
136
star
9

laptime-simulation

This repository contains a quasi-steady-state lap time simulation implemented in Python. It can be used to evaluate the effect of various vehicle parameters on lap time and energy consumption.
Python
99
star
10

NeuralNetwork_for_VehicleDynamicsModeling

Python
95
star
11

sim_vehicle_dynamics

TUM Roborace Team Software Stack - Vehicle Simulation
MATLAB
91
star
12

Lecture_AI_in_Automotive_Technology

This is the github Repository that belongs to the lecture "Artificial Intelligence in Automotive Technology" from the Institute of Automotive Technology of the Technical University of Munich
Jupyter Notebook
84
star
13

race-simulation

This repository contains a race simulation to determine a race strategy for motorsport circuit races. Race strategy in this context means the determination of pit stops.
Python
81
star
14

Lecture_ADSE

Jupyter Notebook
68
star
15

FusionTracking

Multi-Modal Sensor Fusion and Object Tracking for Autonomous Racing
Python
62
star
16

veh_passenger

TUM Roborace Team Software Stack - Example Vehicle
MATLAB
61
star
17

FlexMap_Fusion

ROS 2 Autoware Tool for Map Georeferencing and OSM Fusion
C++
60
star
18

RadarVoxelFusionNet

Python
55
star
19

RadarGNN

A graph neural network for the segmentation and object detection in radar point clouds.
Python
51
star
20

Carla-Autoware-Bridge

Carla 0.9.15 and Autoware Universe Humble
Python
50
star
21

velocity_optimization

Optimizes (Maximizes) the velocity profile for a vehicle with respect to physical constraints (e.g., power, force, combined acceleration, ...). Takes into account a variable friction potential between road and tires. Max. power input can be variable (for e.g., energy strategy purpose).
Python
47
star
22

f1-timing-database

SQLite database containing Formula 1 lap and race timing information for the seasons 2014 - 2019
41
star
23

Multi_LiCa

Multi - LiDAR-to-LiDAR calibration framework for ROS2 and non-ROS applications
31
star
24

teleoperated_driving

Dockerfile
30
star
25

YawMomentDiagrams

Tool to generate yaw moment diagrams for vehicle handling analysis.
Python
29
star
26

ScenarioArchitect

The Scenario Architect provides a lightweight graphical user interface that allows a straightforward realization and manipulation of concrete driving testing scenarios. Exemplary usecases are the validation of an online verification framework or training of an prediction algorithm.
Python
29
star
27

CamRaDepth

Semantic Guided Depth Estimation with Transformers Using Monocular Camera and Sparse Radar
Python
27
star
28

EA_Battery_SPMparameterization

Electrochemical lithium-ion battery model of reduced-order to predict unmeasurable cell states for fast charging control in real time. Methods for parameterization of the model based on half and full cell measurements are provided.
MATLAB
26
star
29

TrajectorySupervisor

Python
21
star
30

LOTUS

MATLAB
20
star
31

sim_battery_system

MATLAB
19
star
32

Wale-Net

Neuronales Netz zur Trajektorienprädiktion von Fahrzeugen mit OnlineLearning
Python
19
star
33

RadarSeg

Python
19
star
34

TechnoEconomicCellSelection

Helps you select the optimal cell to electrify a long-haul truck from a database containing 160 cells.
Python
18
star
35

RID

Roof Information Dataset for CV-Based Photovoltaic Potential Assessment
Python
17
star
36

Eco-Driving

MATLAB
13
star
37

uds-decoder

UDS Decoder zur vereinfachten Umrechnung von Diagnoseabfragen
C#
13
star
38

Component_Library_for_Full_Vehicle_Simulations

MATLAB
13
star
39

sim_BTMS

MATLAB
13
star
40

embes

The repository embes (embedded energy strategy) contains an algorithm to calculate an energy strategy for an all-electric race car in real time.
Python
13
star
41

Electric_Machine_Design

MATLAB
12
star
42

MixNet

Structured Deep Neural Motion Prediction of Opposing Vehicles for an Autonomous Racecar
Python
12
star
43

edgar_digital_twin

Python
12
star
44

Eco_Driving_Toolbox_for_BEVs

Eco-driving toolbox for battery electric vehicles using detailed loss models
MATLAB
11
star
45

Damper-Defect-Detection-using-Machine-Learning

MATLAB
11
star
46

UrbanEV

Java
11
star
47

tpa_map_functions

This repository provides several functions to generate and process race track maps containing specific local information, which is further used for trajectory planning or vehicle dynamics simulation.
Python
11
star
48

AVSensorCoverage

Coverage, redundancy and blind spots of autonomous vehicles
Python
10
star
49

2RC_ECM

Python
10
star
50

Modular-Quasi-Static-Longitudinal-Simulation-for-BEV

MATLAB
9
star
51

Reliability_Models_of_Inverters

MATLAB
9
star
52

MATLAB2CAD

A series of examples to directly connect MATLAB with CATIA V5
MATLAB
9
star
53

dt-cargo

Recorded Real Driving Data and Computed Track-Wise Metadata
Jupyter Notebook
8
star
54

sim_VTMS

MATLAB
7
star
55

Efficiency_Models_of_Inverters_for_BMW_i3

MATLAB
7
star
56

test_scenarios_cooperation

Python
7
star
57

RUMI

Recursive Uncertainty Model Identification
Python
7
star
58

MAGIS

Python
7
star
59

TruckBatteryDesign

Battery design method for battery-electric long-haul trucks
Python
6
star
60

Damper-Defect-Detection-Using-CNN

Python
6
star
61

AuVeCoDe

Tool to design and optimize autonomous vehicle concepts.
MATLAB
6
star
62

Hamburg-Public-Charging-Station-Utilization

Public charging station utilization dataset for the city of Hamburg. Dataset is described in the respective paper: Placing BEV Charging Infrastructure: Influencing Factors, Metrics, and their Influence on Observed Charger Utilization
6
star
63

Staruml2json

Python
6
star
64

motorcycle_model

A multibody code for motorcycle simulation
MATLAB
6
star
65

BTMS-Design

Entwicklungstool zur Auslegung von Batteriethermosystemen in verschiedenen Klimabedingungen
Julia
6
star
66

SETRIC

Python
6
star
67

Sim2RealDistributionAlignedDataset

Sim-to-Real Distribution-Aligned Dataset (S2R-DAD) for Domain Shift and Domain Adaptation Analysis
5
star
68

Labcourse-Mobility-Data-Analysis

Jupyter Notebook
5
star
69

Carla_t2

Carla_T2 Sensor Kit and Vehicle Model for Autoware Universe
Python
5
star
70

GMMCalib

LiDAR-to-LiDAR Calibration
Python
5
star
71

tod_perception

C++
5
star
72

MCS_Analysis

The novel Megawatt Charging System standard Implications on battery size and cell requirements for battery-electric long-haul trucks
Python
5
star
73

EA_Battery_MDF

This repository provides a model deployment framework (MDF) for real-time lithium-ion battery model utilization in CAN-capable test benches. It can be used for the investigation of advanced battery management strategies in short- and long-term experimental studies.
Python
5
star
74

cooperative_behavior_planning

Python
4
star
75

Lane_Level_Matching

4
star
76

Vehicle-specific-Driving-Cycles-

MATLAB
4
star
77

HVAC-Consumption-Calculator

MATLAB
4
star
78

EV_Battery_DVA_Clustering

Repository for battery cell clustering in python
Python
4
star
79

SpeziSpezl

A vending machine system with RFID authentification, payment transaction and resupply tracking and PayPal deposit support.
HTML
4
star
80

TOTEM

Topology-Optimization Tool for Electric Mobility
MATLAB
4
star
81

ad_interface_functions

Interface functions used in the autonomous driving stack at TUM/FTM
Python
4
star
82

AV_Driving_Cycles

This tool develops driving cycles for specific driving style properties (comfort, consumption, fastness, subjective safety) of AVs.It is an ACC simulation of an AV that follows leading vehicle that drives one of the today known cycles. The parameters of the ACC controller vary depending on the driving style of the AV.
MATLAB
4
star
83

EA_Battery_LAB2MAT

Repository of tools for raw data postprocessing of lab devices (e.g. Gamry, Basytec, Biologic, ...) to .MAT files compatibel with Matlab.
MATLAB
4
star
84

VVUQ-Python_Framework

Python
3
star
85

VASEM

Vehicle concept development for Autonomous, Shared and Electric Mobility
MATLAB
3
star
86

Truck-Overtaking-Spot-Analyzer

Python
3
star
87

stakeholder-digital-battery-twin

HTML
3
star
88

SASIM

Smart Advisor for Sustainable Integrated Mobility (SASIM) - Full cost calculator as a routing tool for urban mobility in Munich.
JavaScript
3
star
89

EVRP_optimizer

Coupled fleet, infrastructure and deployment optimization of heterogeneous van fleets with alternative drives (E-C-VRP-HF-TW)
3
star
90

mod_interface_helperfun

TUM Roborace Team Software Stack - Miscellaneous functionality used across all repositories.
MATLAB
3
star
91

VVUQ-Framework

MATLAB
2
star
92

Efficiency-and-Thermal-Behavior-IM

MATLAB
2
star
93

tod_vehicle_interface

C++
2
star
94

1.-Standard-Load-Profile-Generator

2
star
95

LithiumIonCellMaterials

Python
2
star
96

FlexCloud

Georeferencing of Point Cloud Maps
2
star
97

sumo-prt

Python
1
star
98

deefs

Java
1
star
99

Steuerungssoftware_Gasloeslichkeitspruefstand

C++
1
star
100

BatteryBufferedEndStationCharging

Python
1
star