Skip to content

Commit f7d7521

Browse files
committed
intake super stupid
1 parent f1ce2f8 commit f7d7521

File tree

1 file changed

+10
-55
lines changed

1 file changed

+10
-55
lines changed

src/main/java/frc/robot/subsystems/intake/Deploy.java

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import edu.wpi.first.math.trajectory.TrapezoidProfile;
1919
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
2020
import edu.wpi.first.wpilibj2.command.Command;
21+
import edu.wpi.first.wpilibj2.command.Commands;
2122
import edu.wpi.first.wpilibj2.command.SubsystemBase;
2223
import frc.robot.Constants.IntakeConstants;
2324
import java.util.function.DoubleSupplier;
@@ -50,73 +51,27 @@ public Deploy() {
5051
SmartDashboard.putNumber("INTAKE/Deploy Encoder", deployEncoder.getPosition());
5152

5253
deployEncoder.setPosition(1);
53-
SmartDashboard.putNumber("INTAKE/kS", IntakeConstants.kS);
54-
SmartDashboard.putNumber("INTAKE/kG", IntakeConstants.kG);
55-
SmartDashboard.putNumber("INTAKE/kV", IntakeConstants.kV);
56-
SmartDashboard.putNumber("INTAKE/kP", IntakeConstants.kP);
57-
SmartDashboard.putNumber("INTAKE/kI", IntakeConstants.kI);
58-
SmartDashboard.putNumber("INTAKE/kD", IntakeConstants.kD);
5954
SmartDashboard.putNumber("INTAKE/rest speed", rest);
6055
}
6156

62-
// private Command runCMD(double voltage) {
63-
// return run(
64-
// () -> {
65-
// deployMotor.set(speed);
66-
// });
67-
// }
68-
// Adds start and stop for deploying
6957
public Command deployCMD() {
7058
return run(
7159
() -> {
72-
deployMotor.set(
73-
controller.calculate(
74-
deployEncoder.getPosition(), IntakeConstants.DEPLOY_POSITION.in(Radians)));
60+
deployMotor.set(0.2);
7561
});
76-
77-
// // Deploys fuel
78-
// return Commands.sequence(
79-
// Commands.runOnce(
80-
// () -> {
81-
// closedLoopController.setSetpoint(
82-
// IntakeConstants.DEPLOY_POSITION.in(Radians), ControlType.kPosition);
83-
// }, this),
84-
// Commands.waitUntil(closedLoopController::isAtSetpoint),
85-
// Commands.runOnce(() -> deployMotor.set(rest)))
86-
// .withName("Deployed");
87-
}
88-
89-
public Command readyCMD() {
90-
return run(
91-
() -> {
92-
deployMotor.set(
93-
controller.calculate(
94-
deployEncoder.getPosition(), IntakeConstants.READY_POSITION.in(Radians)));
95-
});
96-
97-
// return Commands.runOnce(
98-
// () -> {
99-
// closedLoopController.setSetpoint(
100-
// IntakeConstants.READY_POSITION.in(Radians), ControlType.kPosition);
101-
// }, this)
102-
// .withName("Ready");
103-
10462
}
10563

10664
public Command undeployCMD() {
107-
return run(
65+
return Commands.sequence(
66+
Commands.runOnce(
10867
() -> {
109-
deployMotor.set(
110-
controller.calculate(
111-
deployEncoder.getPosition(), IntakeConstants.UP_POSITION.in(Radians)));
112-
});
68+
deployMotor.set(-0.3);
69+
}),
70+
Commands.waitSeconds(0.5),
71+
Commands.runOnce(() -> {
72+
deployMotor.set(-0.02);
73+
}));
11374

114-
// return Commands.run(
115-
// () -> {
116-
// closedLoopController.setSetpoint(
117-
// IntakeConstants.UP_POSITION.in(Radians), ControlType.kPosition);
118-
// }, this)
119-
// .withName("Retracted");
12075
}
12176

12277
public Command mannualCMD(DoubleSupplier speed) {

0 commit comments

Comments
 (0)