727A Auto Auto Reveal

Hello fellow VRC people! This is my first and last forum post.

This is the reveal for “Auto Auto” aka Autonomous Autonomous. This a program that allowed us, 727A, to program an autonomous route in about 10 minutes, instead of 2 hours. This program removes all the guess work with programming autonomous and allows you to simply drive your robot around the field, all the while recording your movements. Then, using the debug stream, it prints the code to the screen in the form of functions, which allows you to just copy and paste the code into a competition ready program, and the robot will mimic the movements with great accuracy.

Here is a link to our submission for this year’s innovate award at worlds. Even though we did not win the award, this video provides a great overview of the program and you can see it in action!
https://www.youtube.com/watch?v=iB_AtgF-3hM

First, let me start off this post with a little bit about Team 727A. I am Mitchell Overfield, the lead programmer of 727A. Myself, along with Pedro Lima and Andre Ruas, are the only three members of 727A. We all joined our schools brand new robotics club in August of 2012, the beginning of our Junior year. The three of us, previously strangers, became very close and worked almost every day after school from 4pm to 9pm on Sack Attack. And we were lucky enough to qualify for worlds our very first year for the 2013 World Championships.
Our second and last year on the team, this year, all three of us between applying to college and studying for our ACTs and SATs, managed to put in just as much time into robotics as the year before. After winning Design Award at a regional competition for Auto Auto and a modular design system, we qualified for the first ever Florida State Championships. There, we won three awards. We won Tournament Finalists, the Design award, again for Auto Auto and a modular system, and we became the first team to ever receive the Florida State Excellence Award. And, for the second year in a row, we once again qualified for worlds.
After two amazing years, it saddens the three of us to have to leave our school, VEX, and each other behind, but we are all extremely grateful for what VEX has provided us. It has truly changed all of our lives, as we are now going to all be engineers at 3 great universities: Cal Poly SLO, Carnegie Melon, and Johns Hopkins.
Since VEX is now over for all three of us, we decided that it would be best to give back to the community, since it gave so much to us. And this is why we have decided to release Auto Auto in full, and try to help as many teams as possible.

Now that all that sentimental stuff is out of the way, lets get onto the reveal!

The Idea for Auto Auto was Pedro’s, and I, Mitchell, did all the coding. But we couldn’t have done it without all three of us.

All of the code that is attached to this post is heavily edited, so it should help greatly with understanding how Auto Auto works, down to every last semicolon.
I have worked extremely hard to try and get this code to work on any bot, by just changing the pragmas. And this was ultimately successful, if you have a 4 wheel mechanim drive train with a 2 arm lift. This will probably cover the vast majority of bots, and it should be possible with very minor code edits to get this program to work with any bot type. I tried to provide as much information behind each line of code to make it even easier to edit to fit your needs.

Alrighty so attached you will find 3 files, “autoAutoFinal.c”, “pragmas.txt” and “MechWheelFunctions.c”
How Auto Auto works is while you drive your robot, every time you do a movement, such as moving the bot forwards, Auto Auto prints the function that corresponds to that movement, along with the arguments the function needs, such as power a degrees for the encoder, to the debug stream. These functions are the functions that are included in “MechWheelFunctions.c”.
So the first thing you should do when trying to get Auto Auto to work with your robotic is to make a new file in RobotC and copy the contents of the “pragmas.txt” to the new file. Then, go to the Robot Menu, then Motors and Sensors setup. You are then going to want to change these pragmas to match your bots configuration, but you MUST keep the names the same, otherwise the program will not work. Once you do all of this, make sure you use “#include “MechWheelFunctions.c”” after the pragmas in your code. Then try and call one of the functions from MechWheelFunctions.c. You may need to tweak some of the functions to suit your bot, but you should be able to get these functions to work with almost any bot design.

Once you got these basic functions working, it time to open up the main program, “autoAutoFinal.c”. Read through all of the comments in the code. It may be a lot to take in but I really did try to make it as understandable as possible. Now, this is when things start to very greatly on your bot’s design. If you didn’t have to change any of the functions, or even if you changed them but you didn’t have to add any new functions, then Auto Auto should pretty much work right away. However, if you did make some changes, such as not using a gyro for the spin or not using a potentiometer for the arms, you will need to edit Auto Auto a little, but once you get a grasp on the code the edits should be very simple. I tried to point out the most likely places where edits will be needed in the code.

That’s it! You are now ready to run Auto Auto! So as of now you have 3 files open in RobotC: autoAutoFinal, MechWheelFunctions, and the new file you created. This new file can become your competition code, just copy your adjusted pragmas over to whatever code you have been using, or add the rest of your code in the new file. If you are using pre existing code, you will need to most likely edit the names in the code to match your new pragmas. Remember, DO NOT EDIT THE PRAGMAS, otherwise MechWheelFucntions will not work with your main competition code. To clarify, your main competition code is were you have your driver control and autonomous sections. Auto Auto is NOT your competition code. You have to recompile your main code to the Cortex after you use Auto Auto. We lost a match at worlds because we forgot to recompile our comp code and we ran Auto Auto instead, which has no autonomous and no arm limit so we flipped pretty fast :stuck_out_tongue:

Okay so now you can compile Auto Auto to your robot’s Cortex. Make sure you use one of those orange cables that go into the remote for this to work. You need to keep in plugged in compile the code via VEXNET. Also, the black keys tend to work better than the white keys while doing this. Not required, and just less connection drops. So once you hit F5 and can see the Start/Stop box thing, open the Debug Stream. If you don’t know how to access the debug stream, check out this video I made showing you how.
https://www.youtube.com/watch?v=ZzNbzhDS1Ec
Now, use your partner remote (optional, the default power is set to 100%) and select the power you wish. Then, simply press forward on the joystick, and hopefully your robot will move forward, and in the debug stream you will see the forward function, followed by the power and the degrees the robot moved! If you don’t see this/ have other issues, then its debugging time :stuck_out_tongue:
If it all worked, you can try pressing 8R and switching to crab, try spinning etc.
Once you get your route all driven out, simply copy and paste the debug stream code into your main comp code, under the autonomous section. Then compile that code, get your favorite VEX comp switch, and test it out! Hopefully your robot will follow a very similar path to the one you drove in Auto Auto, and, with some minor tweaking, you just saved your self a bunch of time!

I am uploading this code for everyone to use and benefit from. Feel free to use the code as you like and make all the edits you can think of. However, I would like to receive credit and the rights on the original code.

Thank you for taking the time to read this post, I really hope this helps some teams out! I will try my best to keep an eye on the forums and answer as many questions as I can. Thanks to everyone involved with VEX in anyway, this is an incredible program that has changed my life, and have made my dream of being a computer programmer get even closer to reality!

-Mitchell Overfield
autoAuto.zip (8.48 KB)

3 Likes

Not to take away from your sense of accomplishment but this has been around for a while and discussed on multiple threads. My team made something like this at the beginning of last year along with Ruiqi from 2059A. We decided against revealing any “Rerun” code since we were afraid that less experienced teams would use it instead of learning to program themselves. I guess it can’t be helped now, but a bit of warning for teams who want to use programs like this - it’s far from perfect and not nearly as good as code you have written and tuned yourself. Don’t run code you haven’t tested thoroughly, I know of a few teams that lost because their recorded autons caused them to tip or end up stuck etc…

2 Likes

It does not surprise me to learn that other teams have a similar program, after all there are ten thousand teams out there! We decided to reveal Auto Auto after having many individuals come up to us, especially as states and worlds, and asked us how the code worked. Since it takes a decent amount of time to explain, we promised these teams that we would do a reveal on the forums at the end of the year. Even if it helps one team out that would be amazing to me; I know how much it allowed our team to focus on building and innovation else where.

I do believe any team who uses this code will know how to use basic functions to program an autonomous route. In order for them to make the code work for their own robots, there is an intermediate level of coding knowledge required. The main point of Auto Auto is to eliminate the guess work of distances and values, and it simply prints out functions that, all in all, are no more than 8 lines. It’s all pretty basic stuff. So, as I can see it, this program saves hours of guess and check work, which has nothing to do with learning how to code, and provides a surprisingly accurate route that, with minimal tweaking (especially on the turns, their values are usually a little high) can be just as good, if not better than a manually programmed route, which we proved by winning states and making it to worlds. Of course, test the route many times before you take it to comp, but I can be the first to tell you that we have programmed routes using Auto Auto minutes before a match.

Thank you for your feedback :slight_smile:

-Mitchell

1 Like

Thanks for posting the code, I will have a good look at what you have done next weekend. Although written for the past season, it may have been a good candidate for entry into this jpearman’s programming challenge, however, I will still give you some feedback after I try it out.

2 Likes

Awesome! Let me know what you think of it.
And it’s a shame that I did not know of that contest before hand or I would have for sure entered it! Regardless, thank you for taking the time to look at it!

-Mitchell

I realized I have misread that the Programming Challenge was a recent post. Since Auto Auto should work with any years game, is it possible to enter it in the contest anyways?

-Mitchell

Hmm, let me think about that a bit and get back to you. You would need to modify the code a little to comply with the rules. As the competition runs through the end of September I haven’t provided the specifics yet on how entries need to be be submitted, it would also need open source license etc. included. You have made a classic rookie mistake and not included any copyright or indication as to how the code may be used. It would also probably be unfair for me to provide feedback and then allow the updated code to be entered, but let me get back to you via PM later on.

1 Like

I put a “copyright” at the bottom of the actual code. I said it may be used and edited freely, but I would like to receive credit for the original code. I’ll edit the main post to include this information. As this was sorta my last “hurrah” so to speak with VEX I think I would appreciate the feedback more so than entering it into the contest, especially since my college does not have a Vex U team. However my school’s B team has access to the code, so if anything I could allow them to make the edits to comply with the rules if they so desire and enter the code under their name.

Thanks again,

-Mitchell

1 Like

Ok, so I missed that, not used to seeing it at the end of a file.

Hey guys, sorry to hear you’re on the way out. You were awesome competitors throughout the years and it was a lot of fun competing at tournaments with the 727 teams. Good luck in all of your future endeavors!

Edit: You may recall me as Kyle Medeiros, former member of 5900J. You guys picked us as alliance partners at the Bayshore Bot Blast all those years ago! That was the first tournament we ever went to and we got all the way to the finals!

2 Likes