Hey everyone my team has been experimenting with path planner over the last couple of weeks and we have gotten some auton paths ready. The next step from here for our team was to construct a few on the fly trajectories to key points on the game field however I keep running into the same issue which ends up being what to do if something is in the way like another bot or a feature on the field (like the climbing area). I think a rudimentary solution would probably just be using a controller to just move the bot before it smashes into something but I was wondering if we could do something a bit more precise (One misinput and suddenly we’re getting a penalty). One of the ideas I just had was if the bot ever finds another bot it’ll just end the current trajectory and give back the control to driver?
PathPlanner has support for path finding and it lets you define static obstacles on the field. It uses the popular AD* algorithm. For dynamic obstacles such as robots, you can use a camera with a custom model running that detects those obstacles.
Hey thanks for the reply! I was wondering if you could explain how to define the obstacle because im looking at path planner and I don’t see anything that seems to define an obstacle.
There are probably examples you can find on gitHub but I would start with the Pathfinding class in pathPlanner. The java docs are pretty good for it.
https://pathplanner.dev/api/java/com/pathplanner/lib/pathfinding/Pathfinding.html
Actually I believe it uses AD*.
Didn’t realize that, thank you!
No worries. It appears AD* might be more beneficial on less powerful hardware, to give it more time to think about the optimal path. As far as I’ve seen, the replanning it does is rather subtle, and the initial path you get seems to be pretty close to what it will give you seconds later.
We use the regular old A* for our pathfinding solution (PurplePath), running on the coprocessor instead.
Just be aware that I’m not calling dynamic obstacles “officially supported“ this season. It’s possible to get good results with it currently, but you need to be very careful in how you use it and get very used to understanding how it will act for certain things. Play around with it in simulation a whole lot before considering trying it on a real robot.
Is it possible to change the navgrid.json using PathPlannerLib or do I have to parse it?
You can’t change the navgrid, since that is supposed to represent the static field obstacles that will always be there. You can use the dynamic obstacles feature to make some “edits” to it, they just won’t persist.
So for example, if you want to force the pathfinder to go under the stage, add dynamic obstacles to the sides of the stage to block off those paths. When you want to be able to go around again, remove those obstacles.
Stuff like that works well with dynamic obstacles, the stuff that can be jank is when you are changing the obstacles every robot loop with vision detections and such.