|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Autonomous Mode
There are a lot of while statements in that code that don't look at all right to me. For example,
Code:
while (PAN_SERVO > 130)
{
pwm01 = 147;
pwm02 = 147;
pwm03 = 147;
pwm04 = 147;
}
And then try changing those while statments into if statements, which is what it looks like they really ought to be. |
|
#2
|
|||
|
|||
|
Re: Autonomous Mode
just a hint. Try to stay away from while loops as previously mentioned. They mess with your code because othe essential functions are not able to be called when your code is in a while loop.
|
|
#3
|
|||||
|
|||||
|
Re: Autonomous Mode
Ifs and Elses are the key in FRC.
![]() |
|
#4
|
|||
|
|||
|
Re: Autonomous Mode
Don't forget to copy over all the includes at the top of user_routines dealing with the camera. IE tracking.h. You can just copy all the includes from user_routines to user_routines_fast if you wish.
|
|
#5
|
|||
|
|||
|
Re: Autonomous Mode
don't forget the switch statement, which can be more useful or better for use in autonomous.
|
|
#6
|
||||
|
||||
|
Re: Autonomous Mode
Quote:
Most of our routines end up looking something like: Code:
switch (auto_state) {
case INITIALIZE:
Auto_Initialize(); // Set up auto mode
auto_state=FASTASPPROACH
break;
case APPROACH:
// Code that drives towards goals quickly, and at some point
// resets auto_state to SCORE
break;
case SCORE:
// Score many points!
break;
case DONE:
default:
// do nothing!
break;
}
|
|
#7
|
||||
|
||||
|
Re: Autonomous Mode
Yeah, definately don't do loops in autonomous. The while loop in the default code provides the repeat. Just use if-elses to get one thing done before the next happens. That eliminates the possiblility of running into an error becuase the code takes too long to execute and fills the buffer. That would stop the bot cold for the entire match. (Beleive me, I've done it
![]() |
|
#8
|
||||
|
||||
|
Re: Autonomous Mode
Could someone please explain how to "switch" into autonomous mode without using a dongle. I want to test my autonomous code but haven't had time to make a dongle yet.
Thanks |
|
#9
|
|||||
|
|||||
|
Re: Autonomous Mode
Tether to your OI and make the Team number 0000.
|
|
#10
|
||||
|
||||
|
Re: Autonomous Mode
Thanks.
|
|
#11
|
|||||
|
|||||
|
Re: Autonomous Mode
Quote:
If everyone on your team is deathly afraid of soldering, you can buy a dongle from AndyMark. |
|
#12
|
||||
|
||||
|
Re: Autonomous Mode
Quote:
1. Make dongle. 2. Use dongle. Seriously, you really, really, should have a dongle with a disable switch handy when you test autonomous mode. 1 trip to Radio Shack and a half hour with a soldering iron is all it takes. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Autonomous Mode | Slick | Programming | 22 | 01-02-2007 19:26 |
| autonomous mode | seanl | Programming | 6 | 31-01-2007 15:59 |
| Autonomous mode | chs938 | Programming | 1 | 03-02-2006 10:19 |
| Autonomous Mode | David Bryan | Programming | 1 | 21-01-2003 21:15 |
| autonomous mode? | bigwalt | Technical Discussion | 1 | 21-01-2003 01:14 |