jerrym | 1815d88 | 2013-02-14 04:21:29 +0000 | [diff] [blame] | 1 | // 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
|
| 12 | AirCompressor* Robot::airCompressor = 0;
|
| 13 | DriveTrain* Robot::driveTrain = 0;
|
| 14 | ShooterWheelPIDController* Robot::shooterWheelPIDController = 0;
|
| 15 | Shooter* Robot::shooter = 0;
|
| 16 | FrisbeeStorage* Robot::frisbeeStorage = 0;
|
| 17 | FrisbeePickup* Robot::frisbeePickup = 0;
|
| 18 | PickupArm* Robot::pickupArm = 0;
|
| 19 | OI* Robot::oi = 0;
|
| 20 | // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=INITIALIZATION
|
| 21 | void 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 |
|
| 45 | void Robot::AutonomousInit() {
|
| 46 | if (autonomousCommand != NULL)
|
| 47 | autonomousCommand->Start();
|
| 48 | }
|
| 49 |
|
| 50 | void Robot::AutonomousPeriodic() {
|
| 51 | Scheduler::GetInstance()->Run();
|
| 52 | }
|
| 53 |
|
| 54 | void 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 |
|
| 62 | void Robot::TeleopPeriodic() {
|
| 63 | if (autonomousCommand != NULL)
|
| 64 | Scheduler::GetInstance()->Run();
|
| 65 | }
|
| 66 | void Robot::TestPeriodic() {
|
| 67 | lw->Run();
|
| 68 | }
|
| 69 | START_ROBOT_CLASS(Robot);
|