Multiple Autonomous Codes Question

Hokay. So our team wants to have multiple different autonomous codes already prepared for when we go to the competition that do different things depending on where we are placed on the field/what we want our robot to do (turn in circles, head for one of our team’s corners, etc)…

So basically the main code will stay the same and all I want to do is make a bunch of different autonomous codes that I can load quickly into the robot before we go out on the field. Ah yes. Working in Labview by the way.

My problem is: How do I keep everything the same but just change the autonomous for multiple different fileythings. Like, I tried to just edit the autonomous (even renaming the autonomous vi to like ‘spin auto’ or something and then going into the main code and changing the normal autonomous reference to ‘spin auto’) and then I tried the ‘save project as’ type thing, thinking that I could just rename the project… but for some reason it wants to like… use that new autonomous code for every autonomous called in the other projects and I have no clue why! Should I just start a completely new project from scratch and then redo all the work I did in the main vi too? CopyPasta wasn’t working between separate projects.

Thank you in advance for anyone who can help me with this~~~

-Christina

there was another thread which had the same question as you that i saw a few days back so you should look there. here is where you can find it:http://www.chiefdelphi.com/forums/showthread.php?t=73623

Ah yes; Have seen that thready. My problem is that when I change and then try to save an autonomous as something else, it for some reason tries to… I don’t know… overwrite it and use this new autonomous for every different project…? Even though it’s saved under a different name…

Ah yes; Have seen that thready. My problem is that when I change and then try to save an autonomous as something else, it for some reason tries to… I don’t know… overwrite it and use this new autonomous for every different project…? Even though it’s saved under a different name…

that is very strange. can you get the code onto the thread.

Unfortunately I’m not on the right computer for that at the moment…
But will try to describe the situation as best I can.

So I start out by opening the cRIO project thing that I’ve been editting for the past forever. It’s got an autonomous code for going forward then spinning in the middle of the field which is just still called ‘Autonomous Mode’ or whatever it started out as. SO. I’ll edit it to do something else (say go left and pin an opponent robot into the corner) and save that as maybe ‘Autonomous Pin’ or something like that. Then I go to the main code and change the reference to the original autonomous code to ‘Autonomous Pin’ and save the project as something different like “Pin auto code” or something like that. But then I’ll want to go back to the original project with the ‘Autonomous Mode’ code or whatever … and for that project it thinks ‘Autonomous Mode’ is the same as ‘Autonomous Pin’ even though it was clearly saved as something else… grrrr…

So I start out by opening the cRIO project thing that I’ve been editting for the past forever. It’s got an autonomous code for going forward then spinning in the middle of the field which is just still called ‘Autonomous Mode’ or whatever it started out as. SO. I’ll edit it to do something else (say go left and pin an opponent robot into the corner) and save that as maybe ‘Autonomous Pin’ or something like that. Then I go to the main code and change the reference to the original autonomous code to ‘Autonomous Pin’ and save the project as something different like “Pin auto code” or something like that. But then I’ll want to go back to the original project with the ‘Autonomous Mode’ code or whatever … and for that project it thinks ‘Autonomous Mode’ is the same as ‘Autonomous Pin’ even though it was clearly saved as something else… grrrr…

make sure that the reference and what you save it as are the same. I’m not a labview programmer however i know both visual basic and java and i know that can throw the program if they are not the same. another suggestion is to open an entirely new project and then copy and paste the code into the new file and see if that works.

In the other thread it gives the steps.

Some of them you are doing correctly, but I can’t tell on others.

  1. Make the different autonomous VIs and save them. Notice that when you Save As… LV asks if you want the current references in memory to point to the new file. This isn’t what you want. You simply want to make file copy to the new location.

  2. Make another static VI reference and drag your new VI to it.

  3. Add logic to decide which of these will be run when the FMS or DS transitions to Auto.

You do not want to duplicate the project. Keep the Robot Main and all of the autonomous options in one project.

If you have several static VI refs that point to the wrong files, just drag from the project or the file explorer over then again to point them to the correct set of files. By the way, giving them unique icons will help a bunch to tell them apart.

Greg McKaskle

You might have more luck including all your autonomous routines, each of them as one case of a structure that is controlled by a switch or group of switches on your robot. Instead of trying to reload the software just before a match, just flip the switches appropriately and let the program select the case containing the routine you want to run.

Okay, why not just create an input value or series of switches to select which autonomous to use, and just have them all in one huge case structure?

This should ignore all problems, as they’d all be in one file