-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClimbCommand.java
83 lines (67 loc) · 1.79 KB
/
ClimbCommand.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package frc.robot.commands;
import java.util.Set;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandBase;
import edu.wpi.first.wpilibj2.command.Subsystem;
import frc.robot.Constants;
import frc.robot.subsystems.Climb;
public class ClimbCommand extends CommandBase {
Climb climb;
public ClimbCommand(Climb climb) {
this.climb = climb;
addRequirements(climb);
}
public Command extendLowClimb() {
return new Command() {
@Override
public void execute() {
if (climb.getEncoderValue() != Constants.CLIMBER_ENCODER_DISTANCE_LOW) {
climb.setSetpoint(Constants.CLIMBER_ENCODER_DISTANCE_LOW);
} else {
climb.stop();
}
}
@Override
public Set<Subsystem> getRequirements() {
// TODO Auto-generated method stub
return null;
}
};
}
public Command extendMidClimb() {
return new Command() {
@Override
public void execute() {
if (climb.getEncoderValue() != Constants.CLIMBER_ENCODER_DISTANCE_MID) {
climb.setSetpoint(Constants.CLIMBER_ENCODER_DISTANCE_MID);
} else {
climb.stop();
}
}
@Override
public Set<Subsystem> getRequirements() {
// TODO Auto-generated method stub
return null;
}
};
}
public Command retract() {
return new Command() {
@Override
public void execute() {
climb.setSetpoint(Constants.RETRACTER_ENCODER_DISTANCE);
}
@Override
public Set<Subsystem> getRequirements() {
// TODO Auto-generated method stub
return null;
}
};
}
public void overrideClimb() {
// todo ovverride climb retract
}
public void climbExtend() {
// todo ovverride climb extend
}
}