When running the global trajectory planner the 3d velocity profile does not graph. The script exits with the following traceback:
Traceback (most recent call last):
File ".\main_globaltraj.py", line 583, in <module>
trajectory=trajectory_opt)
File "C:\Users\PC1\Documents\git\global_racetrajectory_optimization\helper_funcs_glob\src\result_plots.py", line 102, in result_plots
ax.set_aspect("equal")
File "C:\Users\PC1\Documents\git\global_racetrajectory_optimization\.env\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 324, in set_aspect
"Axes3D currently only supports the aspect argument "
NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'.
Proposed solution
File: helper_funcs_glob\src\result_plots.py
Line: 102
Original: ax.set_aspect("equal")
Proposed change: ax.set_aspect("auto")
With proposed change the charts are displayed successfully
OS Name Microsoft Windows 10 Pro
Version 10.0.19041 Build 19041
User Input
User input in main_globaltraj.py
# ----------------------------------------------------------------------------------------------------------------------
# USER INPUT -----------------------------------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------
# choose vehicle parameter file ----------------------------------------------------------------------------------------
file_paths = {"veh_params_file": "racecar.ini"}
# debug and plot options -----------------------------------------------------------------------------------------------
debug = True # print console messages
plot_opts = {"mincurv_curv_lin": False, # plot curv. linearization (original and solution based) (mincurv only)
"raceline": True, # plot optimized path
"imported_bounds": False, # plot imported bounds (analyze difference to interpolated bounds)
"raceline_curv": False, # plot curvature profile of optimized path
"racetraj_vel": True, # plot velocity profile
"racetraj_vel_3d": True, # plot 3D velocity profile above raceline
"racetraj_vel_3d_stepsize": 1.0, # [m] vertical lines stepsize in 3D velocity profile plot
"spline_normals": True, # plot spline normals to check for crossings
"mintime_plots": False} # plot states, controls, friction coeffs etc. (mintime only)
# select track file (including centerline coordinates + track widths) --------------------------------------------------
# file_paths["track_name"] = "rounded_rectangle" # artificial track
# file_paths["track_name"] = "handling_track" # artificial track
file_paths["track_name"] = "berlin_2018" # Berlin Formula E 2018
# file_paths["track_name"] = "modena_2019" # Modena 2019
# set import options ---------------------------------------------------------------------------------------------------
imp_opts = {"flip_imp_track": False, # flip imported track to reverse direction
"set_new_start": False, # set new starting point (changes order, not coordinates)
"new_start": np.array([0.0, -47.0]), # [x_m, y_m]
"min_track_width": None, # [m] minimum enforced track width (set None to deactivate)
"num_laps": 1} # number of laps to be driven (significant with powertrain-option),
# only relevant in mintime-optimization
# set optimization type ------------------------------------------------------------------------------------------------
# 'shortest_path' shortest path optimization
# 'mincurv' minimum curvature optimization without iterative call
# 'mincurv_iqp' minimum curvature optimization with iterative call
# 'mintime' time-optimal trajectory optimization
opt_type = 'mintime'
# set mintime specific options (mintime only) --------------------------------------------------------------------------
# tpadata: set individual friction map data file if desired (e.g. for varmue maps), else set None,
# e.g. "berlin_2018_varmue08-12_tpadata.json"
# warm_start: [True/False] warm start IPOPT if previous result is available for current track
# var_friction: [-] None, "linear", "gauss" -> set if variable friction coefficients should be used
# either with linear regression or with gaussian basis functions (requires friction map)
# reopt_mintime_solution: reoptimization of the mintime solution by min. curv. opt. for improved curv. smoothness
# recalc_vel_profile_by_tph: override mintime velocity profile by ggv based calculation (see TPH package)
mintime_opts = {"tpadata": None,
"warm_start": False,
"var_friction": None,
"reopt_mintime_solution": False,
"recalc_vel_profile_by_tph": False}
# lap time calculation table -------------------------------------------------------------------------------------------
lap_time_mat_opts = {"use_lap_time_mat": False, # calculate a lap time matrix (diff. top speeds and scales)
"gg_scale_range": [0.3, 1.0], # range of gg scales to be covered
"gg_scale_stepsize": 0.05, # step size to be applied
"top_speed_range": [100.0, 150.0], # range of top speeds to be simulated [in km/h]
"top_speed_stepsize": 5.0, # step size to be applied
"file": "lap_time_matrix.csv"} # file name of the lap time matrix (stored in "outputs")
Description
When running the global trajectory planner the 3d velocity profile does not graph. The script exits with the following traceback:
Proposed solution
File:
helper_funcs_glob\src\result_plots.py
Line: 102 Original:ax.set_aspect("equal")
Proposed change:ax.set_aspect("auto")
With proposed change the charts are displayed successfullyWorking environment
OS version
OS Name Microsoft Windows 10 Pro Version 10.0.19041 Build 19041
User Input
User input in
main_globaltraj.py