TRC Library for FRC (2011) 2011
TRC Library Code Project

TrcRobot Class Reference

#include <TrcRobot.h>

List of all members.

Public Member Functions

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 (__in double period)
double GetPeriod (void)
double GetLoopsPerSec (void)
void StartCompetition (void)

Static Public Attributes

static const double kDefaultPeriod = 0.0

Protected Member Functions

 TrcRobot (void)
 ~TrcRobot (void)

Detailed Description

This class defines and implements the TrcRobot object. This object is basically identical to the IterativeRobot object in the WPI library. It is replicated here mainly for debugging purpose because tracing has been added to the functions as well as performance benchmark.

Definition at line 33 of file TrcRobot.h.


Constructor & Destructor Documentation

TrcRobot::TrcRobot ( void  ) [inline, protected]

Constructor for the TrcRobot class.

Definition at line 460 of file TrcRobot.h.

TrcRobot::~TrcRobot ( void  ) [inline, protected]

Destructor for the TrcRobot class.

Definition at line 476 of file TrcRobot.h.


Member Function Documentation

virtual void TrcRobot::AutonomousContinuous ( void  ) [inline, virtual]

This function is called continuously in autonomous mode.

Definition at line 217 of file TrcRobot.h.

virtual void TrcRobot::AutonomousInit ( void  ) [inline, virtual]

This function is called before starting the autonomous mode.

Definition at line 127 of file TrcRobot.h.

virtual void TrcRobot::AutonomousPeriodic ( void  ) [inline, virtual]

This function is called periodically at fixed intervals in autonomous mode.

Definition at line 171 of file TrcRobot.h.

virtual void TrcRobot::DisabledContinuous ( void  ) [inline, virtual]

This function is called continuously in disabled mode.

Definition at line 199 of file TrcRobot.h.

virtual void TrcRobot::DisabledInit ( void  ) [inline, virtual]

This function is called before starting the disabled mode.

Definition at line 113 of file TrcRobot.h.

virtual void TrcRobot::DisabledPeriodic ( void  ) [inline, virtual]

This function is called periodically at fixed intervals in disabled mode.

Definition at line 156 of file TrcRobot.h.

double TrcRobot::GetLoopsPerSec ( void  ) [inline]

This function gets the number of loops per second for the main loop.

Returns:
Returns frequency of the periodic function calls.

Definition at line 307 of file TrcRobot.h.

double TrcRobot::GetPeriod ( void  ) [inline]

This function gets the period for the periodic functions.

Returns:
Returns period of the periodic function calls.

Definition at line 288 of file TrcRobot.h.

virtual void TrcRobot::RobotInit ( void  ) [inline, virtual]

This function is called one time to do robot-wide initialization.

Definition at line 99 of file TrcRobot.h.

void TrcRobot::SetPeriod ( __in double  period) [inline]

This function sets the period for the periodic functions.

Parameters:
periodThe period of the periodic function calls. 0.0 means sync to driver station control data.

Definition at line 255 of file TrcRobot.h.

void TrcRobot::StartCompetition ( void  ) [inline]

Start a competition. 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. This code needs to track the order of the field starting to ensure that everything happens in the right order. Repeatedly run the correct method, either Autonomous or OperatorControl when the robot is enabled. After running the correct method, wait for some state to change, either the other mode starts or the robot is disabled. Then go back and wait for the robot to be enabled again.

Definition at line 336 of file TrcRobot.h.

virtual void TrcRobot::TeleopContinuous ( void  ) [inline, virtual]

This function is called continuously in teleop mode.

Definition at line 235 of file TrcRobot.h.

virtual void TrcRobot::TeleopInit ( void  ) [inline, virtual]

This function is called before starting the teleop mode.

Definition at line 141 of file TrcRobot.h.

virtual void TrcRobot::TeleopPeriodic ( void  ) [inline, virtual]

This function is called periodically at fixed intervals in teleop mode.

Definition at line 185 of file TrcRobot.h.


Member Data Documentation

const double TrcRobot::kDefaultPeriod = 0.0 [static]

Definition at line 92 of file TrcRobot.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Defines