IterativeRobot Class Reference

#include <IterativeRobot.h>

Inheritance diagram for IterativeRobot:

Inheritance graph
[legend]
Collaboration diagram for IterativeRobot:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void StartCompetition (void)
virtual void RobotInit (void)
virtual void DisabledInit (void)
virtual void AutonomousInit (void)
virtual void TeleopInit (void)
virtual void DisabledPeriodic (void)
virtual void AutonomousPeriodic (void)
virtual void TeleopPeriodic (void)
virtual void DisabledContinuous (void)
virtual void AutonomousContinuous (void)
virtual void TeleopContinuous (void)
void SetPeriod (unsigned periodInMs)

Protected Member Functions

virtual ~IterativeRobot (void)
 IterativeRobot (void)


Detailed Description

IterativeRobot implements a specific type of Robot Program framework, extending the RobotBase class.

The IterativeRobot class is intended to be subclassed by a user creating a robot program.

This class is intended to implement the "old style" default code, by providing the following functions which are called by the main loop, StartCompetition(), at the appropriate times:

RobotInit() -- provide for initialization at robot power-on

Init() functions -- each of the following functions is called once when the appropriate mode is entered:

Periodic() functions -- each of these functions is called iteratively at the appropriate periodic rate (aka the "slow loop"). The default period of the iterative robot is 10,000 microseconds, giving a periodic frequency of 100Hz (100 times per second).

Continuous() functions -- each of these functions is called repeatedly as fast as possible:


Constructor & Destructor Documentation

IterativeRobot::~IterativeRobot ( void   )  [protected, virtual]

Free the resources for a RobotIterativeBase class.

IterativeRobot::IterativeRobot ( void   )  [protected]

Constructor for RobotIterativeBase

The constructor initializes the instance variables for the robot to indicate the status of initialization for disabled, autonomous, and teleop code.


Member Function Documentation

void IterativeRobot::StartCompetition ( void   )  [virtual]

default (in microsec) for periodic functions

Provide an alternate "main loop" via StartCompetition().

This specific StartCompetition() implements "main loop" behavior like that of the FRC control system in 2008 and earlier, with a primary (slow) loop that is called periodically, and a "fast loop" (a.k.a. "spin loop") that is called as fast as possible with no delay between calls.

Implements RobotBase.

void IterativeRobot::RobotInit ( void   )  [virtual]

Robot-wide initialization code should go here.

Users should override this method for default Robot-wide initialization which will be called when the robot is first powered on. It will be called exactly 1 time.

void IterativeRobot::DisabledInit ( void   )  [virtual]

Initialization code for disabled mode should go here.

Users should override this method for initialization code which will be called the first time that the robot enters disabled mode. This function will be called one time when the robot first enters disabled mode.

void IterativeRobot::AutonomousInit ( void   )  [virtual]

Initialization code for autonomous mode should go here.

Users should override this method for initialization code which will be called each time the robot enters autonomous mode.

void IterativeRobot::TeleopInit ( void   )  [virtual]

Initialization code for teleop mode should go here.

Users should override this method for initialization code which will be called each time the robot enters teleop mode.

void IterativeRobot::DisabledPeriodic ( void   )  [virtual]

Periodic code for disabled mode should go here.

Users should override this method for code which will be called periodically at a regular rate while the robot is in disabled mode.

void IterativeRobot::AutonomousPeriodic ( void   )  [virtual]

Periodic code for autonomous mode should go here.

Users should override this method for code which will be called periodically at a regular rate while the robot is in autonomous mode.

void IterativeRobot::TeleopPeriodic ( void   )  [virtual]

Periodic code for teleop mode should go here.

Users should override this method for code which will be called periodically at a regular rate while the robot is in teleop mode.

void IterativeRobot::DisabledContinuous ( void   )  [virtual]

Continuous code for disabled mode should go here.

Users should override this method for code which will be called repeatedly as frequently as possible while the robot is in disabled mode.

void IterativeRobot::AutonomousContinuous ( void   )  [virtual]

Continuous code for autonomous mode should go here.

Users should override this method for code which will be called repeatedly as frequently as possible while the robot is in autonomous mode.

void IterativeRobot::TeleopContinuous ( void   )  [virtual]

Continuous code for teleop mode should go here.

Users should override this method for code which will be called repeatedly as frequently as possible while the robot is in teleop mode.

void IterativeRobot::SetPeriod ( unsigned  periodInMicroSec  ) 

Set the period for the periodic functions.

The period is set in microseconds for the length of time between calls to the periodic functions. Default period is 10,000 microseconds (100Hz iteration loop).


The documentation for this class was generated from the following files:

Generated on Thu Oct 2 14:01:28 2008 for WPI Robotics Library by  doxygen 1.5.5