RobotBase Class Reference

#include <RobotBase.h>

Inheritance diagram for RobotBase:

Inheritance graph
[legend]
Collaboration diagram for RobotBase:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool IsDisabled (void)
bool IsAutonomous (void)
bool IsOperatorControl (void)
bool IsSystemActive (void)
bool IsNewDataAvailable (void)
WatchdogGetWatchdog (void)

Static Public Member Functions

static void startRobotTask (FUNCPTR factory)
static void robotTask (FUNCPTR factory)

Protected Member Functions

virtual ~RobotBase (void)
 RobotBase (void)


Detailed Description

Implement a Robot Program framework. The RobotBase class is intended to be subclassed by a user creating a robot program. Overridden Autonomous() and OperatorControl() methods are called at the appropriate time as the match proceeds. In the current implementation, the Autonomous code will run to completion before the OperatorControl code could start. In the future the Autonomous code might be spawned as a task, then killed at the end of the Autonomous period.

Constructor & Destructor Documentation

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

Free the resources for a RobotBase class. This includes deleting all classes that might have been allocated as Singletons to they would never be deleted except here.

RobotBase::RobotBase ( void   )  [protected]

Constructor for a generic robot program. User code should be placed in the constuctor that runs before the Autonomous or Operator Control period starts. The constructor will run to completion before Autonomous is entered.

This must be used to ensure that the communications code starts. In the future it would be nice to put this code into it's own task that loads on boot so ensure that it runs.


Member Function Documentation

bool RobotBase::IsDisabled ( void   ) 

Determine if the Robot is currently disabled.

Returns:
True if the Robot is currently disabled by the field controls.

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.

bool RobotBase::IsOperatorControl ( void   ) 

Determine if the robot is currently in Operator Control mode.

Returns:
True if the robot is currently operating in Tele-Op mode as determined by the field controls.

bool RobotBase::IsSystemActive ( void   ) 

Check on the overall status of the system.

Returns:
Is the system active (i.e. PWM motor outputs, etc. enabled)?

bool RobotBase::IsNewDataAvailable ( void   ) 

Indicates if new data is available from the driver station.

Todo:
The current implementation is silly. We already know this explicitly without trying to figure it out.
Returns:
Has new data arrived over the network since the last time this function was called?

Watchdog & RobotBase::GetWatchdog ( void   ) 

Return the instance of the Watchdog timer. Get the watchdog timer so the user program can either disable it or feed it when necessary.

void RobotBase::startRobotTask ( FUNCPTR  factory  )  [static]

Start the robot code. This function starts the robot code running by spawning a task. Currently tasks seemed to be started by LVRT without setting the VX_FP_TASK flag so floating point context is not saved on interrupts. Therefor the program experiences hard to debug and unpredictable results. So the LVRT code starts this function, and it, in turn, starts the actual user program.

void RobotBase::robotTask ( FUNCPTR  factory  )  [static]

Static interface that will start the competition in the new task.


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

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