View Single Post
  #5   Spotlight this post!  
Unread 05-04-2010, 18:26
LukeS LukeS is offline
4272 mentor, 1024 alumnus
AKA: Luke Shumaker
FRC #4272
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Indianapolis, IN
Posts: 60
LukeS is an unknown quantity at this point
Re: Modular Autonomous?

Our autonomous was originally pretty complex, Andrew was programming it the hard way. Then I started moving commonly used bits to ralff.whatever (after qbranche's original Robotics Autonomous Language For FIRST). I designed the interface that ralff takes care of just about everything. It generally works like `ralff.do(parameter, time)'. This left turning still fairly complex (our drive train is fairly complex), so I took some code directly from the teleop, and spoof joystick inputs.

Code:
switch (autoMode) {
	case 0://Testing (nothing) mode//////////////////////////////////////////////
		break;
	case 1://Zone 1/////////////////////////////////////////////////
		switch (stage) {
			case 0: if (ralff.driveForward(-1, 1   )) stage++; break;
			case 1: if (ralff.turnBack(0.5,-1, 1.65 )) stage++; break;
			case 2: if (ralff.driveForward(-1, 0.25)) stage++; break;
			case 3: break;
		}
		break;
	case 2://Zone 2/////////////////////////////////////////////////
		switch (stage) {
...