2010 FRC Java API


edu.wpi.first.wpilibj
Class SimpleRobot

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by edu.wpi.first.wpilibj.RobotBase
          extended by edu.wpi.first.wpilibj.SimpleRobot

public class SimpleRobot
extends RobotBase

A robot base class. Users can build thier program off of this by overring the autonomous and operatorControl methods.


Constructor Summary
SimpleRobot()
          Create a new SimpleRobot
 
Method Summary
 void autonomous()
          Autonomous should go here.
 void operatorControl()
          Operator control (tele-operated) code should go here.
 void robotMain()
          Robot main program for free-form programs.
 void startCompetition()
          Start a competition.
 
Methods inherited from class edu.wpi.first.wpilibj.RobotBase
destroyApp, free, getWatchdog, isAutonomous, isDisabled, isEnabled, isNewDataAvailable, isOperatorControl, isSystemActive, pauseApp, startApp
 
Methods inherited from class javax.microedition.midlet.MIDlet
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleRobot

public SimpleRobot()
Create a new SimpleRobot

Method Detail

autonomous

public void autonomous()
Autonomous should go here. Users should add autonomous code to this method that should run while the field is in the autonomous period.


operatorControl

public void operatorControl()
Operator control (tele-operated) code should go here. Users should add Operator Control code to this method that should run while the field is in the Operator Control (tele-operated) period.


robotMain

public void robotMain()
Robot main program for free-form programs. This should be overridden by user subclasses if the intent is to not use the autonomous() and operatorControl() methods. In that case, the program is responsible for sensing when to run the autonomous and operator control functions in their program. This method will be called immediately after the constructor is called. If it has not been overridden by a user subclass (i.e. the default version runs), then the autonomous() and operatorControl() methods will be called.


startCompetition

public void startCompetition()
Start a competition. This code needs to track the order of the field starting to ensure that everything happens in the right order. Currently it waits for the user autonomous code to complete before running the OperatorControl function. Needs to spawn the autonomous code as a task, then kill it after the end of the autonomous period.

Specified by:
startCompetition in class RobotBase

2010 FRC Java API


Copyright © 2006-2009 Sun Microsystems, Inc. All Rights Reserved.