TOTPT solves time-optimal raceline using NLP with direct collocation approach, and performs NMPC path tracking within the racing scenario implemented in Simulink.
- Matlab and Simulink (tested on R2017a and R2022a on Win11)
- Install CasADi
- Install acados for Matlab
Download TOTPT and unzip at local directory
- Run
totpt_env_variables.m
to add subfolders to Matlab search path - Open
acados_env_variables_windows.m
innmpc
folder, fill acados and casadi installation paths in the two lines
acados_dir = 'A:\path\to\acados';
casadi_dir = 'B:\path\to\casadi-3.6.5';
- navigate to
tro
folder, run live scripttro_main
to generate smoothed time-optimal raceline (1~3 min, depend on problem size) - navigate to
nmpc
folder, runnmpc_gen
to generate NMPC mex function and automatically copy it tosim
folder - navigate to
sim
folder, run live scriptracing_sim
to simulate racing scenario
racetrack-database
: racelines and track widths of race tracks, forked from (https://github.com/TUMFTM/racetrack-database)functions
: helper functions for track processingparams
: track smoothing parameters and vehicle parameterstro
: offline time-optimal trajectory optimization frameworknmpc
: online NMPC trajectory tracking framework