Hi Guys from Team Unlimited!
We made something that does the same thing (called TriCiA, the Tracking Viscious Panda...don't ask )

It works perfectly because it intelligently knows which commands to include and it will also normalize things like 91 degrees to 90 to make the robot do perfect turns. It can be tweaked to fit your robot better because we have certain servos which may not be of use to you.
Instructions1)Open RobotC
2)Upload RecordAutonomous.c to robot
3)Run the program
4)Open the "debug stream window" in RobotC
5)Start the joystick window to start driving
6)Open ninjaWolf.exe
7)Copy the text from debug stream and paste it into the window in ninjaWolf

Hit "create" and it will make a bunch of functions (based on stuff we already made).
9)Feel free to also use AutonomousFunctions.c to use the functions generated by ninjaWolf.exe
Downloadshttp://www.mediafire.com/?73al7igqxjghbwx (RecordAutonomous.c)
http://www.mediafire.com/?8i1fz34fz2uz3k7 (ninjaWolf.exe)
http://www.mediafire.com/?x2x9qe925icd91l (AutonomousFunctions.c)
-Good Luck Teams!