|
Page 1 of 1
|
[ 7 posts ] |
|
Proper Autonomous Sample Program
| Author |
Message |
|
tfriez
Site Admin
Joined: Wed Jan 24, 2007 10:42 am Posts: 537
|
 Proper Autonomous Sample Program
Here is a sample program for a proper autonomous program... 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.  |  |  |  | Code: #pragma config(Hubs, S1, HTMotor, HTServo, none, none) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, PIDControl) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c" //Include the Joystick/Game variables driver.
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
motor[motorD] = 50; motor[motorE] = 50; wait1Msec(3000);
motor[motorD] = 0; motor[motorE] = 0; }
|  |  |  |  |
_________________Timothy Friez ROBOTC Developer - SW Engineer tfriez@robotc.net
|
| Wed Sep 24, 2008 1:06 pm |
|
 |
|
Jeff McBride
Professor
Joined: Fri Sep 19, 2008 1:22 am Posts: 200
|
 Re: Proper Autonomous Sample Program
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 McBride Benson Robotics Club
|
| Sun Oct 05, 2008 1:27 pm |
|
 |
|
mannie
Rookie
Joined: Wed Mar 05, 2008 11:37 am Posts: 3
|
 Re: Proper Autonomous Sample Program
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). Mannie
|
| Fri Oct 10, 2008 4:41 pm |
|
 |
|
BPSRoboBucs
Rookie
Joined: Fri Nov 14, 2008 4:51 pm Posts: 2
|
 Re: Proper Autonomous Sample Program
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 0429 Rookie 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 pm Posts: 75 Location: 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
_________________ PHUHS Robotics Team 516 FTW
Daytona Robofest Winning Alliance Captain Daytona Robofest Inspire Award
|
| Tue Dec 09, 2008 8:20 pm |
|
 |
|
BPSRoboBucs
Rookie
Joined: Fri Nov 14, 2008 4:51 pm Posts: 2
|
 Re: Proper Autonomous Sample Program
OK. Thanks. What can we change that to, to get the autonomous to work?
_________________
BPS RoboBucs- FTC Team 0429 Rookie Year- 2007
2008 Tempest N' Tampa VEX Qualifier - Excellence Award
Attending 2008/2009 VEX World Championships - Dallas, Texas
|
| Wed Dec 10, 2008 5:05 am |
|
 |
|
10nisman94
Novice
Joined: Mon Oct 13, 2008 6:29 pm Posts: 75 Location: Florida, USA
|
 Re: Proper Autonomous Sample Program
delete the whole line
_________________ PHUHS Robotics Team 516 FTW
Daytona Robofest Winning Alliance Captain Daytona Robofest Inspire Award
|
| Wed Dec 10, 2008 3:12 pm |
|
|
|
Page 1 of 1
|
[ 7 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|