import org.usfirst.frc.team3501.robot.commands.*;
public class OI {
+
private Joystick left, right;
public OI() {
left = new Joystick(RobotMap.LEFT_JOYSTICK_PORT);
right = new Joystick(RobotMap.RIGHT_JOYSTICK_PORT);
- right.whenPressed(1, new CloseClaw());
+ right.whenPressed(1, new CloseClaw());
right.whenReleased(1, new OpenClaw());
-
- right.whenPressed(2, new ToggleClaw());
+ right.whenPressed(2, new ToggleClaw());
right.whenPressed(11, new TurnOffCompressor());
right.whenPressed(12, new TurnOffCompressor());
-
- right.whenPressed(7, new TurnOnCompressor());
- right.whenPressed(8, new TurnOnCompressor());
+ right.whenPressed(7, new TurnOnCompressor());
+ right.whenPressed(8, new TurnOnCompressor());
// potential bug point: this should "Just Work" because as soon as
// command stops running, left stick pos at 0 should take over...
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
public class RobotMap {
+
// driver station
public static final int LEFT_JOYSTICK_PORT = 0, RIGHT_JOYSTICK_PORT = 1;
public static final double MAX_DRIVE_SPEED = 0.7;
- // claw
- public static final int CLAW_FORWARD_CHANNEL = 0, CLAW_REVERSE_CHANNEL = 1;
-
- public static final Value OPEN = Value.kForward, CLOSED = Value.kReverse;
-
// arm
public static final int LEFT_WINCH_ADDRESS = 2, RIGHT_WINCH_ADDRESS = 7;
public static final double ARM_ADJUST_SPEED = 0.3;
+ // claw
+ public static final int CLAW_FORWARD_CHANNEL = 0, CLAW_REVERSE_CHANNEL = 1;
+
+ public static final Value OPEN = Value.kForward, CLOSED = Value.kReverse;
+
// auton
public static final double OVER_STEP_TIME = 1.2, OVER_STEP_SPEED = 0.7,
PAST_STEP_TIME = 1.5, PAST_STEP_SPEED = 0.5,
- PICKUP_TIME = 1.4, PICKUP_SPEED = 0.5;
+ PICKUP_TIME = 1.4, PICKUP_SPEED = 0.5;
}
package org.usfirst.frc.team3501.robot.autons;
+import org.usfirst.frc.team3501.robot.Robot;
import org.usfirst.frc.team3501.robot.RobotMap;
import org.usfirst.frc.team3501.robot.commands.*;
public PickUpContainer() {
super("PickUpContainer");
+ requires(Robot.arm);
+ requires(Robot.claw);
+
queueCommands();
}
left.set(0);
}
- public double getSpeedFromJoystick(double speed) {
+ private double getSpeedFromJoystick(double speed) {
if (Math.abs(speed) < RobotMap.MIN_ARM_JOYSTICK_INPUT)
speed = 0;
public void drive(double forward, double twist) {
if (Math.abs(forward) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
forward = 0;
- if (Math.abs(twist) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
+ if (Math.abs(twist) < RobotMap.MIN_DRIVE_JOYSTICK_INPUT)
twist = 0;
robotDrive.arcadeDrive(