projects
/
3501
/
stronghold-2016
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4333819
)
bugfixes
author
Harel Dor
<hareldor@gmail.com>
Thu, 10 Mar 2016 02:21:21 +0000
(18:21 -0800)
committer
Harel Dor
<hareldor@gmail.com>
Thu, 10 Mar 2016 02:21:21 +0000
(18:21 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/OI.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
patch
|
blob
|
blame
|
history
diff --git
a/src/org/usfirst/frc/team3501/robot/Constants.java
b/src/org/usfirst/frc/team3501/robot/Constants.java
index 0b376c7181d4aef8ca55b632ade5ed708d72713f..3c27d4884bb6ad77b8342cc5605196b1e674559f 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Constants.java
+++ b/
src/org/usfirst/frc/team3501/robot/Constants.java
@@
-37,9
+37,9
@@
public class Constants {
}
public static class DriveTrain {
}
public static class DriveTrain {
- public static final int TANK
_DRIVE
= 0;
- public static final int ARCADE
_DRIVE
= 1;
- public static final int DRIVE_TYPE = TANK
_DRIVE
;
+ public static final int TANK = 0;
+ public static final int ARCADE = 1;
+ public static final int DRIVE_TYPE = TANK;
// Drivetrain Motor related ports
public static final int DRIVE_FRONT_LEFT = 1;
// Drivetrain Motor related ports
public static final int DRIVE_FRONT_LEFT = 1;
@@
-99,6
+99,7
@@
public class Constants {
public static final Value RETRACT = DoubleSolenoid.Value.kReverse;
public static final int IN = 1;
public static final Value RETRACT = DoubleSolenoid.Value.kReverse;
public static final int IN = 1;
+ public static final int STOP = 0;
public static final int OUT = -1;
// for roller
public static final int OUT = -1;
// for roller
diff --git
a/src/org/usfirst/frc/team3501/robot/OI.java
b/src/org/usfirst/frc/team3501/robot/OI.java
index 07352f8787161fe5f47dcb614322a0e50cde57a0..0acc3c8067067d572ee34a525ce9fad7f4115fdc 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/OI.java
+++ b/
src/org/usfirst/frc/team3501/robot/OI.java
@@
-66,14
+66,17
@@
public class OI {
intake = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT);
intake.whenPressed(new RunIntake(Constants.IntakeArm.IN));
intake = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT);
intake.whenPressed(new RunIntake(Constants.IntakeArm.IN));
+ intake.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
outtake1 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT);
outtake1.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
outtake1 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT);
outtake1.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
+ outtake1.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
outtake2 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT);
outtake2.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
outtake2 = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT);
outtake2.whenPressed(new RunIntake(Constants.IntakeArm.OUT));
+ outtake2.whenReleased(new RunIntake(Constants.IntakeArm.STOP));
shooterUp = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT);
shooterUp = new JoystickButton(rightJoystick,
Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT);
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
index 42ed83fc3f38b5a0c0970f52aa1103fe6c0af63a..c69b350631e777c30fa65a792f8d1a2928092f18 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/intakearm/RunIntake.java
@@
-17,8
+17,10
@@
public class RunIntake extends Command {
protected void initialize() {
if (direction == Constants.IntakeArm.IN)
Robot.intakeArm.intakeBall();
protected void initialize() {
if (direction == Constants.IntakeArm.IN)
Robot.intakeArm.intakeBall();
- else
+ else
if (direction == Constants.IntakeArm.OUT)
Robot.intakeArm.outputBall();
Robot.intakeArm.outputBall();
+ else
+ Robot.intakeArm.stopRollers();
}
@Override
}
@Override
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
index 779bd9dec0ad0e0c98ad0fe440d6ffc181babe78..eeac4900e1b9a5f44b8ca2e1951012c9b3b55376 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
@@
-1,7
+1,6
@@
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
-import org.usfirst.frc.team3501.robot.Robot;
import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive;
import edu.wpi.first.wpilibj.CANTalon;
import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive;
import edu.wpi.first.wpilibj.CANTalon;
@@
-195,15
+194,15
@@
public class DriveTrain extends PIDSubsystem {
public void joystickDrive(double left, double right) {
int type = Constants.DriveTrain.DRIVE_TYPE;
double k = (isFlipped() ? -1 : 1);
public void joystickDrive(double left, double right) {
int type = Constants.DriveTrain.DRIVE_TYPE;
double k = (isFlipped() ? -1 : 1);
- if (type == Constants.DriveTrain.TANK
_DRIVE
) {
+ if (type == Constants.DriveTrain.TANK) {
robotDrive.tankDrive(-left * k, -right * k);
robotDrive.tankDrive(-left * k, -right * k);
- } else if (type == Constants.DriveTrain.ARCADE
_DRIVE
) {
+ } else if (type == Constants.DriveTrain.ARCADE) {
robotDrive.arcadeDrive(left * k, right);
}
}
public void setMotorSpeeds(double left, double right) {
robotDrive.arcadeDrive(left * k, right);
}
}
public void setMotorSpeeds(double left, double right) {
- double k = (
Robot.driveTrain.
isFlipped() ? -1 : 1);
+ double k = (isFlipped() ? -1 : 1);
robotDrive.tankDrive(-left * k, -right * k);
}
robotDrive.tankDrive(-left * k, -right * k);
}