1 package org
.usfirst
.frc3501
.RiceCatRobot
.robot
;
3 import org
.usfirst
.frc3501
.RiceCatRobot
.subsystems
.Arm
;
4 import org
.usfirst
.frc3501
.RiceCatRobot
.subsystems
.Claw
;
5 import org
.usfirst
.frc3501
.RiceCatRobot
.subsystems
.DriveTrain
;
7 import edu
.wpi
.first
.wpilibj
.Compressor
;
8 import edu
.wpi
.first
.wpilibj
.IterativeRobot
;
9 import edu
.wpi
.first
.wpilibj
.Timer
;
10 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
12 public class Robot
extends IterativeRobot
{
15 public static DriveTrain driveTrain
;
16 public static Arm arm
;
17 public static Claw claw
;
18 public static Compressor compressor
;
20 public void robotInit() {
22 driveTrain
= new DriveTrain();
26 compressor
= new Compressor(RobotMap
.COMPRESSOR_PORT
);
29 public void autonomousInit() {
32 public void autonomousPeriodic() {
33 Scheduler
.getInstance().run();
36 public void teleopInit() {
37 System
.out
.println("running teleopInit");
40 public void teleopPeriodic() {
41 Scheduler
.getInstance().run();
45 public void operate() {
46 driveTrain
.arcadeDrive(OI
.rightJoystick
.getY(),
47 OI
.rightJoystick
.getTwist());
48 claw
.doTriggerAction();
49 if (OI
.leftJoystick
.getRawButton(8)) {
50 arm
.setArmSpeeds(0.3);
51 } else if (OI
.leftJoystick
.getRawButton(9)) {
52 arm
.setArmSpeeds(-0.3);
53 } else if (OI
.leftJoystick
.getRawButton(6)) {
55 } else if (OI
.leftJoystick
.getRawButton(7)) {
57 } else if (OI
.leftJoystick
.getRawButton(11)) {
59 } else if (OI
.leftJoystick
.getRawButton(10)) {
62 if (Math
.abs(OI
.leftJoystick
.getY()) < 0.05) {
66 arm
.fineTuneControl(OI
.leftJoystick
.getY());