We have recently been working on an A* path planning script for use in FRC, and we wanted to be able to visualize the current path that has been calculated in FRC Web Components.
Basically, how would we overlay a line on top of the field image that follows a given set of points?
How would we go about doing this?
I would recommend just doing this in AdvantageScope. You can very easily graph WPILib Field 2D objects and view them as trajectories.
But can I easily view that live? I want the visualization to be seen live during a match, along with any other indicators/data on the dashboard.
You can look at it live during testing. Needing to see the path live during a match does not generally seem practical.
I want to disagree, the operator could glance down at the display and know if the path produced is good or nonsensical, and let the driver know, “hey, don’t use the auto drive function right now”.
To be a little blunt, I think that if you can’t trust that the path will always be right it’s really not a feature that’s ready to be used on the field. If the point is to make things easier/smoother/faster for the driver then they need to be able to trust it.
If the point is just to gather data at an offseason without really worrying about the competitive aspect, I imagine a log file would be more useful anyway. But I hope that you find a tool that does what you’re looking for regardless.
It could also be not necessarily a bad path but one that goes through a robot, that isn’t in the field graph.
Why not a button to pause the path until a robot clears out of the way? It should be pretty easy to notice an oncoming collision.
The loop between generating the path, having the operator understand the path and the real environment, and the operator approving the path seems like it would be on the order of magnitude of a few seconds. I would recommend descoping the usage to areas where you know there is minimal intervention (scoring action or double sub pickup when in loading zone).
What if I just wanted the live visualisation to look cool?
Yeah, the way I see it being used is the driver has to hold a button down to execute, and if there’s something unexpected in the way, the driver releases said button, and the robot returns to driver control.
Are you using the dashboard app or creating a custom dashboard? If you’re using the app the field component automatically shows trajectories that you’ve added in your robot code:
I see. Can I get it to display dynamic on-the-fly generated paths? What topic do I need to push paths to on NetworkTables in order to get FRC web components to visualize them?
Awesome! Thanks!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.