1 package org
.usfirst
.frc3501
.RiceCatRobot
;
3 import org
.usfirst
.frc3501
.RiceCatRobot
.commands
.LimitSwitchTest
;
4 import org
.usfirst
.frc3501
.RiceCatRobot
.subsystems
.Arm
;
5 import org
.usfirst
.frc3501
.RiceCatRobot
.subsystems
.Claw
;
6 import org
.usfirst
.frc3501
.RiceCatRobot
.subsystems
.DriveTrain
;
8 import edu
.wpi
.first
.wpilibj
.Compressor
;
9 import edu
.wpi
.first
.wpilibj
.IterativeRobot
;
10 import edu
.wpi
.first
.wpilibj
.Timer
;
11 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
13 public class Robot
extends IterativeRobot
{
16 public static DriveTrain driveTrain
;
17 public static Arm arm
;
18 public static Claw claw
;
19 public static Compressor compressor
;
21 public void robotInit() {
23 driveTrain
= new DriveTrain();
27 compressor
= new Compressor(RobotMap
.COMPRESSOR_PORT
);
30 public void autonomousInit() {
33 public void autonomousPeriodic() {
34 Scheduler
.getInstance().run();
37 public void teleopInit() {
38 System
.out
.println("running teleopInit");
39 Scheduler
.getInstance().add(new LimitSwitchTest());
42 public void teleopPeriodic() {
43 Scheduler
.getInstance().run();
47 public void operate() {
49 .arcadeDrive(OI
.rightJoystick
.getY(), OI
.rightJoystick
.getTwist());
50 claw
.doTriggerAction();
51 if (OI
.leftJoystick
.getRawButton(8)) {
52 arm
.setArmSpeeds(0.3);
53 } else if (OI
.leftJoystick
.getRawButton(9)) {
54 arm
.setArmSpeeds(-0.3);
55 } else if (OI
.leftJoystick
.getRawButton(6)) {
57 } else if (OI
.leftJoystick
.getRawButton(7)) {
59 } else if (OI
.leftJoystick
.getRawButton(11)) {
61 } else if (OI
.leftJoystick
.getRawButton(10)) {
64 if (Math
.abs(OI
.leftJoystick
.getY()) < 0.05) {
68 arm
.fineTuneControl(OI
.leftJoystick
.getY());