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
/
RunWinch.java
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java
b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java
index 5acd6d1e1042736d59ee83a819bc5350d05e1846..39149abb14fba12c4c77e24d5aaf2d694da20bf6 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java
@@
-1,13
+1,14
@@
package org.usfirst.frc.team3501.robot.commands.climber;
import org.usfirst.frc.team3501.robot.Robot;
package org.usfirst.frc.team3501.robot.commands.climber;
import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Climber;
-import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
/**
* This command runs the winch at a specified speed and time in seconds when the
import edu.wpi.first.wpilibj.command.Command;
/**
* This command runs the winch at a specified speed and time in seconds when the
- * button triggering it is pressed.
+ * button triggering it is pressed. This command also makes the drive train
+ * motors run because the winch is controlled by the drive train.
*
* pre-condition: This command is run by a button in OI. The robot must be
* attached to the rope.
*
* pre-condition: This command is run by a button in OI. The robot must be
* attached to the rope.
@@
-23,40
+24,44
@@
import edu.wpi.first.wpilibj.command.Command;
*/
public class RunWinch extends Command {
*/
public class RunWinch extends Command {
- Timer timer;
+ Climber climber = Robot.getClimber();
+
private double time;
private double motorVal;
/**
private double time;
private double motorVal;
/**
+ * See JavaDoc comment in class for details
*
*
- * @author shivanighanta
- *
+ * @param time
+ * time in seconds to run the winch
+ * @param motorVal
+ * value range is from -1 to 1
*/
*/
- public RunWinch(
double time, double motorVal
) {
- requires(
Robot.getClimber()
);
+ public RunWinch() {
+ requires(
climber
);
this.time = time;
this.motorVal = motorVal;
}
@Override
protected void initialize() {
this.time = time;
this.motorVal = motorVal;
}
@Override
protected void initialize() {
- timer.start();
- Robot.getClimber().setMotorValue(motorVal);
+ climber.setCANTalonsBrakeMode(climber.COAST_MODE);
}
@Override
protected void execute() {
}
@Override
protected void execute() {
-
+ climber.setMotorValues(climber.CLIMBER_SPEED);
}
@Override
protected boolean isFinished() {
}
@Override
protected boolean isFinished() {
- return timer.get() >= time;
+ // return timeSinceInitialized() >= time;
+ return false;
}
@Override
protected void end() {
}
@Override
protected void end() {
-
Robot.getClimber()
.stop();
+
climber
.stop();
}
@Override
}
@Override