projects
/
3501
/
2017steamworks
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
competition fixes
[3501/2017steamworks]
/
src
/
org
/
usfirst
/
frc
/
team3501
/
robot
/
commands
/
climber
/
RunWinchContinuous.java
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
index 6b8db75cc2c8eee9ccc09bb0572eeec1257c75f9..06fa1547db2131986d6ea88af5fba47ca3c1387c 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
@@
-1,6
+1,8
@@
package org.usfirst.frc.team3501.robot.commands.climber;
package org.usfirst.frc.team3501.robot.commands.climber;
+import org.usfirst.frc.team3501.robot.OI;
import org.usfirst.frc.team3501.robot.Robot;
import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Climber;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Command;
@@
-8,8
+10,8
@@
import edu.wpi.first.wpilibj.command.Command;
* This command runs the drive train motors (which runs the winch) continuously
* at a specified speed until the button triggering it is released
*
* This command runs the drive train motors (which runs the winch) continuously
* at a specified speed until the button triggering it is released
*
- * pre-condition: This command must be run by a button in OI
. The robot must be
- * attached to the rope.
+ * pre-condition: This command must be run by a button in OI
with
+ *
button.whileHeld(...). The robot must be
attached to the rope.
*
* post-condition: Drive train motors set to a specified speed.
*
*
* post-condition: Drive train motors set to a specified speed.
*
@@
-17,7
+19,8
@@
import edu.wpi.first.wpilibj.command.Command;
*
*/
public class RunWinchContinuous extends Command {
*
*/
public class RunWinchContinuous extends Command {
- private double motorVal;
+ Climber climber = Robot.getClimber();
+ private double climbingSpeed;
/**
* See JavaDoc comment in class for details
/**
* See JavaDoc comment in class for details
@@
-25,19
+28,19
@@
public class RunWinchContinuous extends Command {
* @param motorVal
* value range is from -1 to 1
*/
* @param motorVal
* value range is from -1 to 1
*/
- public RunWinchContinuous(
double motorVal
) {
- requires(
Robot.getDriveTrain()
);
-
this.motorVal = motorVal
;
+ public RunWinchContinuous() {
+ requires(
climber
);
+
climbingSpeed = climber.CLIMBER_SPEED
;
}
@Override
protected void initialize() {
}
@Override
protected void initialize() {
- Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
}
@Override
protected void execute() {
}
@Override
protected void execute() {
-
+ double thrust = OI.leftJoystick.getY();
+ climber.setMotorValues(-thrust);
}
@Override
}
@Override
@@
-47,7
+50,7
@@
public class RunWinchContinuous extends Command {
@Override
protected void end() {
@Override
protected void end() {
-
+ climber.stop();
}
@Override
}
@Override