You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use this API to get the track yaw angle and curvature based on GPS data to run my laptime sims.
Then I was trying to use your algorithm to understand how you import the track data and get the racing line from it. However, when I try to run the main_globaltraj.py I have this error.
It seems that there is a optimization function being called in line 95 of the spline_approximation function, and the data size of the arguments are wrong.
This was the very same error I had when trying to use only the functions I needed to calculate the curvature analytically.
Here is the error log:
Traceback (most recent call last):
File "/home/pedroc/dev/global_racetrajectory_optimization/main_globaltraj.py", line 243, in
helper_funcs_glob.src.prep_track.prep_track(reftrack_imp=reftrack_imp,
File "/home/pedroc/dev/global_racetrajectory_optimization/helper_funcs_glob/src/prep_track.py", line 39, in prep_track
reftrack_interp = tph.spline_approximation.
File "/home/pedroc/dev/global_racetrajectory_optimization/venv/lib/python3.10/site-packages/trajectory_planning_helpers/spline_approximation.py", line 95, in spline_approximation
closest_t_glob_cl[i] = optimize.fmin(dist_to_p,
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/optimize/_optimize.py", line 622, in fmin
res = _minimize_neldermead(func, x0, args, callback=callback, **opts)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/optimize/_optimize.py", line 772, in _minimize_neldermead
fsim[k] = func(sim[k])
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/optimize/_optimize.py", line 496, in function_wrapper
fx = function(np.copy(x), *(wrapper_args + args))
File "/home/pedroc/dev/global_racetrajectory_optimization/venv/lib/python3.10/site-packages/trajectory_planning_helpers/spline_approximation.py", line 146, in dist_to_p
return spatial.distance.euclidean(p, s)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/spatial/distance.py", line 518, in euclidean
return minkowski(u, v, p=2, w=w)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/spatial/distance.py", line 462, in minkowski
v = _validate_vector(v)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/spatial/distance.py", line 301, in _validate_vector
raise ValueError("Input vector should be 1-D.")
ValueError: Input vector should be 1-D.
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
I was trying to use this API to get the track yaw angle and curvature based on GPS data to run my laptime sims.
Then I was trying to use your algorithm to understand how you import the track data and get the racing line from it. However, when I try to run the main_globaltraj.py I have this error.
It seems that there is a optimization function being called in line 95 of the spline_approximation function, and the data size of the arguments are wrong.
This was the very same error I had when trying to use only the functions I needed to calculate the curvature analytically.
Here is the error log:
Traceback (most recent call last):
File "/home/pedroc/dev/global_racetrajectory_optimization/main_globaltraj.py", line 243, in
helper_funcs_glob.src.prep_track.prep_track(reftrack_imp=reftrack_imp,
File "/home/pedroc/dev/global_racetrajectory_optimization/helper_funcs_glob/src/prep_track.py", line 39, in prep_track
reftrack_interp = tph.spline_approximation.
File "/home/pedroc/dev/global_racetrajectory_optimization/venv/lib/python3.10/site-packages/trajectory_planning_helpers/spline_approximation.py", line 95, in spline_approximation
closest_t_glob_cl[i] = optimize.fmin(dist_to_p,
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/optimize/_optimize.py", line 622, in fmin
res = _minimize_neldermead(func, x0, args, callback=callback, **opts)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/optimize/_optimize.py", line 772, in _minimize_neldermead
fsim[k] = func(sim[k])
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/optimize/_optimize.py", line 496, in function_wrapper
fx = function(np.copy(x), *(wrapper_args + args))
File "/home/pedroc/dev/global_racetrajectory_optimization/venv/lib/python3.10/site-packages/trajectory_planning_helpers/spline_approximation.py", line 146, in dist_to_p
return spatial.distance.euclidean(p, s)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/spatial/distance.py", line 518, in euclidean
return minkowski(u, v, p=2, w=w)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/spatial/distance.py", line 462, in minkowski
v = _validate_vector(v)
File "/home/pedroc/.local/lib/python3.10/site-packages/scipy/spatial/distance.py", line 301, in _validate_vector
raise ValueError("Input vector should be 1-D.")
ValueError: Input vector should be 1-D.
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: