Is there a way to have PathPlannerLib infer the heading for each path point based on the previous and next points?
I’ve got a separate A* pathfinding program that spits out points that are roughly 30cm apart for most of the path, then 1cm apart for the last 30cm or so. And I want to use PathPlannerLib to drive the path defined by those points.
No, it can’t be that simple. You need to do some work with the points before trying to fit a path to it, or it will probably give you some really weird results. Not to mention the performance implications of generating dozens of spline trajectories over the whole path with that many points. The on the fly stuff in the current pathplanner lib is really not great to deal with for stuff like this. There is a pathfinding implementation in 2024 pplib that handles all of this stuff. Properly fitting a bezier curve to the points given by a pathfinding algorithm needs some intentional placement of control points, which the on-the-fly stuff is not great for.
The heading is very necessary, you can’t just leave it at 0. You could calculate it yourself from the angle from one point to the next, but it will still likely give you pretty bad results.
My script already generates paths like this, post-processed and smoothed.
The following path is defined by 1000 points. I just need to generate a trajectory defined by a path that I’ve already found.
If its pre smoothed then you’d just want to pass those points directly to a trajectory to generate off of them instead of fitting a spline. 2023 PPLib does not really allow this, 2024 will.