package org.usfirst.frc.team3501.bases;
+import org.usfirst.frc.team3501.robot.OI;
+import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Arm;
+import org.usfirst.frc.team3501.robot.subsystems.Claw;
+import org.usfirst.frc.team3501.robot.subsystems.Drivetrain;
+import org.usfirst.frc.team3501.robot.subsystems.Pneumatics;
+import org.usfirst.frc.team3501.util.AutonData;
+
import edu.wpi.first.wpilibj.command.Scheduler;
public abstract class Command
- extends edu.wpi.first.wpilibj.command.Command
- implements CommandBase {
+ extends edu.wpi.first.wpilibj.command.Command {
+
+ protected static OI oi;
+
+ protected static AutonData autonData;
+
+ protected static Drivetrain drivetrain;
+ protected static Arm arm;
+ protected static Claw claw;
+
+ protected static Pneumatics pneumatics;
public Command(String commandName) {
super(commandName);
+
+ oi = Robot.oi;
+
+ autonData = Robot.autonData;
+
+ drivetrain = Robot.drivetrain;
+ arm = Robot.arm;
+ claw = Robot.claw;
+
+ pneumatics = Robot.pneumatics;
}
protected void schedule(Command c) {
+++ /dev/null
-package org.usfirst.frc.team3501.bases;
-
-import org.usfirst.frc.team3501.robot.OI;
-import org.usfirst.frc.team3501.robot.Robot;
-import org.usfirst.frc.team3501.robot.subsystems.*;
-import org.usfirst.frc.team3501.util.AutonData;
-
-public interface CommandBase {
-
- final static OI oi = Robot.oi;
-
- final static AutonData autonData = Robot.autonData;
-
- final static Drivetrain drivetrain = Robot.drivetrain;
- final static Arm arm = Robot.arm;
- final static Claw claw = Robot.claw;
-
- final static Pneumatics pneumatics = Robot.pneumatics;
-}
package org.usfirst.frc.team3501.bases;
+import org.usfirst.frc.team3501.robot.OI;
+import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Arm;
+import org.usfirst.frc.team3501.robot.subsystems.Claw;
+import org.usfirst.frc.team3501.robot.subsystems.Drivetrain;
+import org.usfirst.frc.team3501.robot.subsystems.Pneumatics;
+import org.usfirst.frc.team3501.util.AutonData;
+
public abstract class CommandGroup
- extends edu.wpi.first.wpilibj.command.CommandGroup
- implements CommandBase {
+ extends edu.wpi.first.wpilibj.command.CommandGroup {
+
+ protected static OI oi;
+
+ protected static AutonData autonData;
+
+ protected static Drivetrain drivetrain;
+ protected static Arm arm;
+ protected static Claw claw;
+
+ protected static Pneumatics pneumatics;
public CommandGroup(String commandGroupName) {
super(commandGroupName);
+
+ oi = Robot.oi;
+
+ autonData = Robot.autonData;
+
+ drivetrain = Robot.drivetrain;
+ arm = Robot.arm;
+ claw = Robot.claw;
+
+ pneumatics = Robot.pneumatics;
}
}
public Joystick(int port) {
super(port);
- IntStream.rangeClosed(1, 12).forEach((b) -> {
+ buttons = new HashMap<Integer, JoystickButton>();
+
+ IntStream.rangeClosed(1, getButtonCount()).forEach((b) -> {
buttons.put(b, new JoystickButton(this, b));
});
}
private Command autonomousCommand;
public void robotInit() {
- oi = new OI();
-
drivetrain = new Drivetrain();
arm = new Arm();
claw = new Claw();
autonData = new AutonData();
+ oi = new OI();
+
chooseAuto();
}
public void teleopInit() {
schedule(new TurnOnCompressor());
- autonomousCommand.cancel();
+ if (autonomousCommand != null)
+ autonomousCommand.cancel();
}
public void teleopPeriodic() {
public DriveWithJoysticks() {
super("DriveWithJoysticks");
+
requires(drivetrain);
}