blob: 691f0339d1db933b38b83ed335573b3b0eee1fde [file] [log] [blame]
jerrym1815d882013-02-14 04:21:29 +00001// RobotBuilder Version: 0.0.2
2//
3// This file was generated by RobotBuilder. It contains sections of
4// code that are automatically generated and assigned by robotbuilder.
5// These sections will be updated in the future when you export to
6// C++ from RobotBuilder. Do not put any code or make any change in
7// the blocks indicating autogenerated code or it will be lost on an
8// update. Deleting the comments indicating the section will prevent
9// it from being updated in th future.
10#include "Robot.h"
11// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=INITIALIZATION
12AirCompressor* Robot::airCompressor = 0;
13DriveTrain* Robot::driveTrain = 0;
14ShooterWheelPIDController* Robot::shooterWheelPIDController = 0;
15Shooter* Robot::shooter = 0;
16FrisbeeStorage* Robot::frisbeeStorage = 0;
17FrisbeePickup* Robot::frisbeePickup = 0;
18PickupArm* Robot::pickupArm = 0;
19OI* Robot::oi = 0;
20 // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=INITIALIZATION
21void Robot::RobotInit() {
22 RobotMap::init();
23 // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
24 airCompressor = new AirCompressor();
25 driveTrain = new DriveTrain();
26 shooterWheelPIDController = new ShooterWheelPIDController();
27 shooter = new Shooter();
28 frisbeeStorage = new FrisbeeStorage();
29 frisbeePickup = new FrisbeePickup();
30 pickupArm = new PickupArm();
31 // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
32 // This MUST be here. If the OI creates Commands (which it very likely
33 // will), constructing it during the construction of CommandBase (from
34 // which commands extend), subsystems are not guaranteed to be
35 // yet. Thus, their requires() statements may grab null pointers. Bad
36 // news. Don't move it.
37 oi = new OI();
38 lw = LiveWindow::GetInstance();
39 // instantiate the command used for the autonomous period
40 // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
41 autonomousCommand = new AutonomousCommand();
42 // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
43 }
44
45void Robot::AutonomousInit() {
46 if (autonomousCommand != NULL)
47 autonomousCommand->Start();
48}
49
50void Robot::AutonomousPeriodic() {
51 Scheduler::GetInstance()->Run();
52}
53
54void Robot::TeleopInit() {
55 // This makes sure that the autonomous stops running when
56 // teleop starts running. If you want the autonomous to
57 // continue until interrupted by another command, remove
58 // this line or comment it out.
59 autonomousCommand->Cancel();
60}
61
62void Robot::TeleopPeriodic() {
63 if (autonomousCommand != NULL)
64 Scheduler::GetInstance()->Run();
65}
66void Robot::TestPeriodic() {
67 lw->Run();
68}
69START_ROBOT_CLASS(Robot);