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
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
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)