Now you can download a copy of these docs so you can use them offline! Download now

#include <RobotBase.h>

Inheritance diagram for RobotBase:
Collaboration diagram for RobotBase:

Public Member Functions

bool IsEnabled ()
 
bool IsDisabled ()
 
bool IsAutonomous ()
 
bool IsOperatorControl ()
 
bool IsTest ()
 
bool IsSystemActive ()
 
bool IsNewDataAvailable ()
 
WatchdogGetWatchdog ()
 

Static Public Member Functions

static RobotBasegetInstance ()
 
static void setInstance (RobotBase *robot)
 
static void startRobotTask (FUNCPTR factory)
 
static void robotTask (FUNCPTR factory, Task *task)
 

Protected Member Functions

virtual ~RobotBase ()
 
virtual void StartCompetition ()=0
 
 RobotBase ()
 

Static Protected Member Functions

static void WriteVersionString ()
 

Protected Attributes

Taskm_task
 
Watchdog m_watchdog
 
DriverStationm_ds
 

Friends

class RobotDeleter
 

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.

Definition at line 37 of file RobotBase.h.

Constructor & Destructor Documentation

RobotBase::~RobotBase ( )
protectedvirtual

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.

Definition at line 56 of file RobotBase.cpp.

RobotBase::RobotBase ( )
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.

Definition at line 44 of file RobotBase.cpp.

Member Function Documentation

Watchdog & RobotBase::GetWatchdog ( )

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

Definition at line 79 of file RobotBase.cpp.

bool RobotBase::IsAutonomous ( )

Determine if the robot is currently in Autnomous mode.

Returns
True if the robot is currently operating Autonomously as determined by the field controls.

Definition at line 106 of file RobotBase.cpp.

bool RobotBase::IsDisabled ( )

Determine if the Robot is currently disabled.

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

Definition at line 97 of file RobotBase.cpp.

bool RobotBase::IsEnabled ( )

Determine if the Robot is currently enabled.

Returns
True if the Robot is currently enabled by the field controls.

Definition at line 88 of file RobotBase.cpp.

bool RobotBase::IsNewDataAvailable ( )

Indicates if new data is available from the driver station.

Returns
Has new data arrived over the network since the last time this function was called?

Definition at line 133 of file RobotBase.cpp.

bool RobotBase::IsOperatorControl ( )

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.

Definition at line 115 of file RobotBase.cpp.

bool RobotBase::IsSystemActive ( )

Check on the overall status of the system.

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

Definition at line 69 of file RobotBase.cpp.

bool RobotBase::IsTest ( )

Determine if the robot is currently in Test mode.

Returns
True if the robot is currently running tests as determined by the field controls.

Definition at line 124 of file RobotBase.cpp.

void RobotBase::robotTask ( FUNCPTR  factory,
Task task 
)
static

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

Definition at line 141 of file RobotBase.cpp.

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. Therefore 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.

Definition at line 164 of file RobotBase.cpp.


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

Generated on Sat Apr 26 2014 12:26:46 for WPILibC++ by doxygen 1.8.6