At the FTC competition, you will manually start your autonomous program, but your program can't "execute" until it receives a command from the Field Management system that it no long "disabled".... here's some code to get you started with that.

task main(){ getJoystickSettings(joystick); //Updates the game and joystick variables

while(joystick.StopPgm) //Continues this loop while the robot is disabled (StopPgm = true) { getJoystickSettings(joystick); //Checks to see if the robot has been enabled (StopPgm = false) wait1Msec(50); //Waits 50 milliseconds for a new BT packet to come. }

// Autonomous Code Below - You can put all of your autonomous program below

We just had a "Train the Trainers" workshop with Mannie Lowe from FIRST. It turns out that the model for this year allows for a single program or two programs. Dick, have you received the details on the exact behavior yet and will it be implemented for 1.45?

_________________Jeff McBrideBenson Robotics Club

Sun Oct 05, 2008 1:27 pm

mannie

Rookie

Joined: Wed Mar 05, 2008 11:37 amPosts: 3

Re: Proper Autonomous Sample Program

Jeff McBride wrote:

We just had a "Train the Trainers" workshop with Mannie Lowe from FIRST. It turns out that the model for this year allows for a single program or two programs. Dick, have you received the details on the exact behavior yet and will it be implemented for 1.45?

Uh-oh. the secret is out...

Tim: Here's what I did to handle both auto and teleop in the single program. This assumes that the new version of RobotC doesn't end the single program between Auto and teleop (as it currently does in 1.44).

// has the FMS stopped the program if (joystick.StopPgm) { nxtDisplayTextLine(2, "Disabled"); wait1Msec(50); stopMotors(); // this routine sets all active motors to 0 - exercise left to student. continue; // go back into top of while loop }

We were at a qualifying competition at Hillsborough High School about 3 or 4 weeks ago and the example template (containing both the autonomous code and teleop code in one program) that everyone originally received for the software inspection was wrong and didn't work properly with the field system. Fortunately, Exploding Bacon provided a code that did work. Unfortunately, after the competition that template got overwritten on my computer as I hit recompile before I changed and saved the file name.

Does anybody have this template that they KNOW FOR SURE WORKS WITH THE FIELD MANAGEMENT SYSTEM from one of the qualifying competitions this year?

Thanks.

_________________BPS RoboBucs- FTC Team 0429Rookie Year- 2007

2008 Tempest N' Tampa VEX Qualifier - Excellence Award

Attending 2008/2009 VEX World Championships - Dallas, Texas

Tue Dec 09, 2008 8:08 pm

10nisman94

Novice

Joined: Mon Oct 13, 2008 6:29 pmPosts: 75Location: Florida, USA

Re: Proper Autonomous Sample Program

the one above is fine just delete the if (!joystick.usermode), this messed up autonomous, but tele-op was fine, i was there 2

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum