-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing name of Auto in GUI does not remove old name from RIO or Chooser on Driver Station #681
Comments
Hi Dave, This isn't really anything to do with PathPlanner, so its a stretch to call it a bug. The files are copied onto the RIO by Visual Studio when a deploy code is done. The PathPlanner GUI doesn't directly access the RIO file system, but rather puts files into the deploy folder inside your project folder on your coding computer, that will get copied on to the RIO. So as you said in Describe the bug, you have to manually FTP into the RIO to delete excess files from the deploy folder that you don't want there, as both VSCode and Pathplanner don't have any idea what files are currently on the RIO in the deploy folder. Maybe there is some way that the VS Code Deploy option could be modified to delete the entire contents of the deploy folder on the RIO and then copy every file across again. This would add to your deploy times, but it would fix your problem. Personally we don't use BuildAutoChooser for this exact reason, but rather use the RIO preferences table to hold a list of strings that will populate the auto chooser. The keys are named Auto01, Auto02, , , Auto12. When we want to have an auto listed on the dashboard we modify one of these entries in the preferences table to include the filename of the auto we want displayed. NB: A RIO Reboot is required to make this entry appear in the AutoChooser. This does introduce another step to adding an auto to your robot, and it also introduces a potential source of error if the file name isn't typed exactly the same, but for us, this gave us complete control over what appears in our auto chooser and in what order and it also didn't require us to recompile code to add an auto to our robot. The only thing that needs to be done, was a "deploy", to copy any new/modified pathplanner files onto the RIO. This is code in the robot container constructor that builds the chooser. It's a bit messy, but it gets the job done.
This code lives in the Robot.cpp to populate the preferences table if the keys don't exist.
Using this method also give you the ability to have different chooser values on different robots. While we didn't have a 2nd bot this year, we have used this feature in the past when prototyping code on different robots. |
I'd guessed that was how Pathplanner deployed everything to the RIO (i.e. get VS Code to do it). Sorry for the "bug" label in that case, the lack of a way to handle changing or deleting files natively in the GUI isn't really your fault if VS Code is the root of the problem. Annoying that the deploy doesn't populate the RIO folder with what's on the laptop exactly, including renames/deletes. I haven't seen anything on editing the way the deploy happens myself but can look and see if I find something. I can try your RIO preferences method out the next time we have the bot powered on (sometime this summer most likely). Though reading through it I'm guessing in the first code segment that builds the Chooser the "break" statement in the first IF block is intended to be a "continue". Break exits the entire loop, so the remaining entries would be skipped. |
Hey Dave, In regards to your statement.
Just to be clear. I can't take any credit for writing Pathplanner. This amazing program, that is supplied free of charge to all teams is all Micheal's doing. I'm just a programming mentor from a team that uses PathPlanner that was offering a suggestion as a work around. This is not an official response from the authors of Path Planner and I suspect Micheal would be horrified at that poorly written code I supplied, but it works for us. I did a bit of looking around the web and I think you could automated the clearing of that deploy folder if you wanted to.
Where
A quick google search should tell you what is needed here. I just tested it with an Also, there is a post on chief delphi talking about this exact topic. I'd check back there as well, as there is something there that talks about tasks happening in parallel. If this code was well and truly before the We need an old DOS programmer to step in here and tell us how it should be done. In regards to
Yep, I'd say you are correct here. This code has been around for a couple of years in our code base and I thing we initially had all our auto entries blank. So the idea was, once you got to a blank entry it would stop populating the chooser. As it stands at the moment, we just choose the filename with the auto chooser and then built the command at run time when Auto launches. I think next year we will prebuild all the auto command groups on code start and then have the chooser pick which one to run. This will eliminate the problem where the scheduler gets a little bit behind when auto starts because it has to build the auto before it can run it and this was taking more than 20ms for us. Hope you can get it working. Regards |
Describe the bug
Editing the name of an Auto or Path within the Pathplanner GUI does not remove the old filename from the RoboRIO on the next deploy. This results in a copy of the file in question with both names to be present on the RIO even though the GUI only shows the new name. Most obvious when editing the name of an Auto and using the "buildAutoChooser()" function to add an Auto Routine Chooser to the driver station. Both the original and the edited names of the Auto will appear on the Chooser list on the Driver Station. Needed to Anonymously FTP into RIO to delete originally named files.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Delete original file(s) for renamed Autos on RoboRIO when deploying renamed Pathplanner files. Only Autos shown in GUI should appear on Driver Station Chooser.
Versions: (please complete the following information):
The text was updated successfully, but these errors were encountered: