Closed alessiogambi closed 4 years ago
A note inside spline_approximation.py
says: "The function can only be used for closable tracks, i.e. track is closed at the beginning!"
So I guess that this explains why it does not work. But maybe @StahlTim or someone else can suggest how to solve this?
Since the coordinates that I provide are already interpolated using a spline, for the moment I can skip spline_approximation. This avoids stumbling on the problem of intersecting splines, but the resulting trajectory still shows some "weirdness:"
Hi, as you have already noted, the approach is currently only implemented for closed tracks. It is certainly possible to include the case of unclosed tracks, as in your case, but this would require reworking several parts of the code. Since the global trajectory planner is currently not actively developed (simply because of limited capacity), we do not plan to include this feature in the near future. A quick and dirty solution for your problem could be to remove the checks in the code, temporarily add points before and after your road segment, and cut them away after optimization (mostly, the optimization still works).
@heilmeiera Thanks for the clarification and the suggestion. This is exactly what I am doing right now, working my way inside the code and tweaking it or setting is_close
flags to false here and there. T
FYI, I managed to tweak the code enough to get what I needed. In case someone else needs it, tag me here.
@alessiogambi I got this issue solved by adapt the matrix for start and end points. (Refer to @heilmeiera 's paper Eq.[16], Minimum Curvature Trajectory Planning and Control for an Autonomous Racecar, VSD 2019). If you or anyone still need it pls. let me know.
@berlala Yes, I am still interested. I have a couple of ideas I would like to discuss, but maybe we can do this by email.
For the future:
I just merged the following PR in our helper functions repository: https://github.com/TUMFTM/trajectory_planning_helpers/pull/2 The updated version of that repository is made available via Pypi as version 0.76.
The function opt_min_curv of that repository (which is ultimately what is used within global_racetrajectory_optimization for the minimum curvature optimization) is now able to handle open tracks. The pre-processing within global_racetrajectory_optimization must still be adapted, i.e. it does not work out of the box. However, it makes things much easier if you want to optimize open tracks.
Hello, I'm struggling with getting a curvature minimization for open tracks. What exactly do I have to adapt or what's the best way to adapt the pre-processing within global_racetrajectory_optimization? Thanks for your help!
FYI, I managed to tweak the code enough to get what I needed. In case someone else needs it, tag me here. I am really interested in what you did @alessiogambi
Would it be possible for you to talk about it? Many thanks!
@GabrieleRini I need to dig up the changes and it might take a while. Did you check @berlala solution?
Hi, I am trying to compute the optimal trajectory for a generic road. Since this is not a track, the road is not closed. This case is considered in the script that generates the friction map, but it might not be contemplated for computing optimal trajectories.
When I run
main_globaltraj.py
I get the following message: OSError: At least two spline normals are crossed, check input or increase smoothing factor!The plot shows the road as expected, but also an additional connection between the first and last point (see the attached screenshot) that causes the above error.