View Single Post
  #7   Spotlight this post!  
Unread 15-01-2009, 11:34
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: IsAutonomous() function

Quote:
Originally Posted by eagle33199 View Post
From the doxygen output:



So what you're doing there is asking if you're in autonomous mode inside of your autonomous loop, and then doing nothing with that information!

When using an iterative robot, you don't need to call IsAutonomous() - the loop will only run while you are in autonomous, and will stop when you aren't. If you're running a simple robot (with no build in looping structure, you'll want to put something similar to:

Code:
void Autonomous(void) 
{
    while(IsAutonomous())
    {
        //do your autonomous stuff
        watchdog.feed();
    }
}
I think what he was trying to say (sorry if I get this wrong) is that his code works if he calls IsAutonomous(), but doesn't if he doesn't.

As I said in my previous response, I think that this is an issue with the stdout buffer not getting flushed.
Reply With Quote