TUMFTM / global_racetrajectory_optimization

This repository contains multiple approaches for generating global racetrajectories.
GNU Lesser General Public License v3.0
473 stars 193 forks source link

Generating a friction map from included tracks does work #3

Closed mheidebr closed 3 years ago

mheidebr commented 3 years ago

Hi everyone from TUM! Thanks for publishing this code publicly, it works very well. I've cloned the code and I am going to use it for a personal project. I've found this issue with generating friction maps, please see below.

Thanks,

Matt

Description

I tried to generate a friction map using the included tracks (berlin_2018, etc.) and the script fails with the following output:

(.env) PS C:\Users\PC1\Documents\git\global_racetrajectory_optimization> python .\main_gen_frictionmap.py
Traceback (most recent call last):
  File ".\main_gen_frictionmap.py", line 64, in <module>
    bool_isclosed_refline = frictionmap.src.reftrack_functions.check_isclosed_refline(refline=reftrack[:, :2])
IndexError: too many indices for array

Inputs

track_name = "berlin_2018"
initial_mue = 0.8
cellwidth_m = 2.0
inside_trackbound = 'left'
bool_show_plots = True

Proposed Soluction

This was fixed by making the following change: File: frictionmap\src\reftrack_functions.py Line: 28 Original: reftrack = np.genfromtxt(fh, delimiter=';') Fix: reftrack = np.genfromtxt(fh, delimiter=',')

Description: delimiters in included track files are , not ; as the import function was expecting, resulting in no data being imported into the reftrack variable

With the proposed solution friction maps are generated successfully from included tracks

Local working environment

(.env) PS C:\Users\PC1\Documents\git\global_racetrajectory_optimization> pip freeze
casadi==3.5.1
certifi==2020.12.5
cycler==0.10.0
Cython==0.29.22
joblib==1.0.1
kiwisolver==1.3.1
matplotlib==3.3.1
numpy==1.18.1
Pillow==8.1.0
pyparsing==2.4.7
python-dateutil==2.8.1
quadprog==0.1.7
scikit-learn==0.23.1
scipy==1.3.3
six==1.15.0
threadpoolctl==2.1.0
trajectory-planning-helpers==0.71
PS C:\Users\PC1\Documents\git\global_racetrajectory_optimization> python --version
Python 3.7.7

OS: OS Name Microsoft Windows 10 Pro Version 10.0.19041 Build 19041