I had a quick question. When i was looking at the example code for pathplanner I read about Automatic Pathfinding. I was wondering if i put a pose dose it flip the pose based on which side it is on.
I belive what you’re looking for is this. On the bottom of the code example there is a line about flipping.
Curiously pathfindToPose
does not flip but pathfindThenFollowPath
does flip. Since you can’t guarantee the heading at the end of the pathfind I have found myself ending the paths a little before where I need to then using a short path to guarantee the proper rotation and get the path flipping.
I actually brought this up in my post
Also this works with PathPlannerAuto
too.
The pathfinding is inherently blue alliance origin only, so the only thing that should ever be flipped would be a pre-made GUI path that was made on the blue side when running on red. Also, it doesn’t really make sense to handle flipping for poses that are provided at run-time, since these could be “correct” already. For instance, we create pathfindToPose commands with either a red side pose or a blue side pose depending on the current alliance. If these were flipped it would break things. If you want to use blue-side only poses, you’ll have to flip them manually beforehand if on red. But, I’d suggest having separate red/blue poses anyways, since it just makes more sense/is more readable and makes adjusting for differences on the red/blue side easier.
This note was about the direction of travel, mainly for diff drive robots. You can’t control the direction it arrives at a position from, but you can give it a rotation that it will target. But, just like with normal paths, if there is not enough distance/time to complete the rotation it won’t be completed. So, adding a short path at the end won’t necessarily solve that. The only way to actually gurantee the correct rotation with any length pathfinding path is to run a pid controller to reach the desired rotation after the path ends.
are the x, y, and roation on the pathplanner GUI the same as pose 2d parameters.