From 3cd438bd5b650a27b84ef37224025cd7f6086e7c Mon Sep 17 00:00:00 2001 From: Logan Howard Date: Fri, 17 Apr 2015 19:44:55 -0700 Subject: [PATCH] misc cleanup --- src/org/usfirst/frc/team3501/robot/OI.java | 11 +++++------ src/org/usfirst/frc/team3501/robot/RobotMap.java | 13 +++++++------ .../frc/team3501/robot/autons/PickUpContainer.java | 4 ++++ .../usfirst/frc/team3501/robot/subsystems/Arm.java | 2 +- .../frc/team3501/robot/subsystems/Drivetrain.java | 2 +- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index 82c4217..1dc8e1c 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -5,22 +5,21 @@ import java.util.Arrays; 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... diff --git a/src/org/usfirst/frc/team3501/robot/RobotMap.java b/src/org/usfirst/frc/team3501/robot/RobotMap.java index 5e73c65..2f2da69 100644 --- a/src/org/usfirst/frc/team3501/robot/RobotMap.java +++ b/src/org/usfirst/frc/team3501/robot/RobotMap.java @@ -3,6 +3,7 @@ package org.usfirst.frc.team3501.robot; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; public class RobotMap { + // driver station public static final int LEFT_JOYSTICK_PORT = 0, RIGHT_JOYSTICK_PORT = 1; @@ -15,18 +16,18 @@ public class RobotMap { 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; } diff --git a/src/org/usfirst/frc/team3501/robot/autons/PickUpContainer.java b/src/org/usfirst/frc/team3501/robot/autons/PickUpContainer.java index 9b08d1f..b930f12 100644 --- a/src/org/usfirst/frc/team3501/robot/autons/PickUpContainer.java +++ b/src/org/usfirst/frc/team3501/robot/autons/PickUpContainer.java @@ -1,5 +1,6 @@ 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.*; @@ -10,6 +11,9 @@ public class PickUpContainer extends CommandGroup { public PickUpContainer() { super("PickUpContainer"); + requires(Robot.arm); + requires(Robot.claw); + queueCommands(); } diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java b/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java index f42de1d..eb11c8a 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Arm.java @@ -34,7 +34,7 @@ public class Arm extends Subsystem { left.set(0); } - public double getSpeedFromJoystick(double speed) { + private double getSpeedFromJoystick(double speed) { if (Math.abs(speed) < RobotMap.MIN_ARM_JOYSTICK_INPUT) speed = 0; diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java index 90e7847..1267f2c 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Drivetrain.java @@ -25,7 +25,7 @@ public class Drivetrain extends Subsystem { 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( -- 2.30.2