Understanding the robot lifecycle - MDHSRobotics/TeamWiki GitHub Wiki
#Understanding the robot lifecycle
The robot goes through the following lifecycle prescribed by the FRC framework. When the robot powers up, it executes the code in the robotInit() method. This is where the initial robot initialization should be placed. In our framework, the code in the configureRobot() and configureOI() methods is called when the robot is in this state.
The robot has 4 main states:
- disabled
- autonomous
- teleop
- test
Each state has an init() method and a periodic method(). The respective init() methods are used to configure settings specific to that state. For example, it may be desirable to ensure that a solenoid is in an off state whenever the robot is in disabled mode. The disabledInit() method could be used to set the solenoid to the desired state. The respective periodic methods are repeatedly called while the robot is in that particular state. The periodic methods are called about every 20 ms by the robot framework.