View Single Post
  #5   Spotlight this post!  
Unread 15-01-2009, 11:00
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,738
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: IsAutonomous() function

From the doxygen output:

Quote:
bool RobotBase::IsAutonomous ( void )

Determine if the robot is currently in Autnomous mode.

Returns:
True if the robot is currently operating Autonomously as determined by the field controls.
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();
    }
}
Reply With Quote