Skip to content

Commit a887a50

Browse files
committed
button binding back
1 parent bd8e3d0 commit a887a50

File tree

14 files changed

+228
-520
lines changed

14 files changed

+228
-520
lines changed

src/main/java/frc/robot/Autos.java

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import choreo.auto.AutoTrajectory;
77
import edu.wpi.first.math.geometry.Pose2d;
88
import edu.wpi.first.math.geometry.Rotation2d;
9-
import edu.wpi.first.wpilibj.DriverStation;
109
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
1110
import edu.wpi.first.wpilibj2.command.Command;
1211
import edu.wpi.first.wpilibj2.command.Commands;
@@ -143,43 +142,6 @@ public AutoRoutine simpleShoot() {
143142
return routine;
144143
}
145144

146-
public AutoRoutine middleShootOnly() {
147-
AutoRoutine routine = autoFactory.newRoutine("middleShootOnly");
148-
149-
routine
150-
.active()
151-
.onTrue(
152-
Commands.parallel(
153-
Commands.sequence(
154-
Commands.waitSeconds(1),
155-
shooter.rawFlywheelCMD(() -> 0.25),
156-
Commands.waitUntil(
157-
() -> {
158-
return shooter.atSpeed();
159-
}),
160-
// Commands.runOnce(drive::stopWithX),//maybe
161-
hopper.shootCMD())));
162-
163-
return routine;
164-
}
165-
166-
public AutoRoutine simplerShoot() {
167-
AutoRoutine routine = autoFactory.newRoutine("");
168-
169-
routine
170-
.active()
171-
.onTrue(
172-
Commands.sequence(
173-
Commands.deadline(
174-
Commands.waitSeconds(12.5),
175-
Commands.parallel(
176-
shooter.rawFlywheelCMD(() -> 3.2),
177-
Commands.sequence(Commands.waitSeconds(1), hopper.shootCMD()))),
178-
Commands.parallel(Commands.waitSeconds(1), shooter.stopCMD(), hopper.stopCMD())));
179-
180-
return routine;
181-
}
182-
183145
public AutoRoutine depotAndClimb(boolean addClimb) {
184146
AutoRoutine routine = autoFactory.newRoutine("DepotAndClimb");
185147

@@ -190,9 +152,8 @@ public AutoRoutine depotAndClimb(boolean addClimb) {
190152
.active()
191153
.onTrue(
192154
Commands.sequence(
193-
sendState("Auto Started!"),
194-
DriveCommands.autoAlign(drive, collect.getInitialPose().orElse(drive.getPose())),
195155
collect.resetOdometry(),
156+
sendState("Auto Started!"),
196157
Commands.parallel(collect.cmd(), deploy.deployCMD())));
197158

198159
collect.atTime("intake").onTrue(Commands.sequence(intake.intakeCMD(), sendState("Intaking!")));
@@ -209,11 +170,12 @@ public AutoRoutine depotAndClimb(boolean addClimb) {
209170

210171
if (addClimb) {
211172
collect
212-
.doneDelayed(10)
173+
.doneDelayed(8)
213174
.onTrue(
214175
Commands.parallel(
215176
sendState("Aligning!"),
216-
DriveCommands.autoClimb(drive, climber),
177+
climb.cmd(),
178+
climber.raiseCMD(),
217179
hopper.stopCMD(),
218180
shooter.stopCMD(),
219181
deploy.undeployCMD()));
@@ -274,18 +236,4 @@ public AutoRoutine midClimbLeft() {
274236
public AutoRoutine midClimbRight() {
275237
return null;
276238
}
277-
278-
public Command theOnlyAuto() {
279-
return Commands.parallel(
280-
Commands.sequence(
281-
Commands.waitSeconds(1),
282-
shooter.rawFlywheelCMD(() -> 0.25),
283-
Commands.waitUntil(
284-
() -> {
285-
DriverStation.reportWarning("theonlyauto", false);
286-
return shooter.atSpeed();
287-
}),
288-
// Commands.runOnce(drive::stopWithX),//maybe
289-
hopper.shootCMD()));
290-
}
291239
}

src/main/java/frc/robot/Constants.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static final class DriveConstants {
3838
public static final double SLOWMODE = 0.6;
3939
public static final double POINT_DEADBAND = 0.4;
4040
public static final Pose2d POSE_RESET =
41-
new Pose2d(Meters.of(3.61), Meters.of(3.87), Rotation2d.kZero);//CHANGED
41+
new Pose2d(Meters.of(2), Meters.of(2), Rotation2d.kZero);
4242
public static final int GYRO_ID = 0; // TODO
4343
public static final Angle ALIGN_SHOOTER_COMP =
4444
Radians.of(
@@ -66,10 +66,10 @@ public static final class VisionConstants {
6666
new Transform3d(Units.inchesToMeters(12), 0, 0.5, new Rotation3d(0.0, 0.0, 0.0));
6767
public static Transform3d robotToCamera1 =
6868
new Transform3d(
69-
-0.132,
70-
-0.248,
71-
0.0513 + 0.115 + 0.0375,
72-
new Rotation3d(0.0, Units.degreesToRadians(-25), Math.PI / 2));
69+
Units.inchesToMeters(7),
70+
Units.inchesToMeters(12),
71+
0.1,
72+
new Rotation3d(0.0, -0.6, Math.PI / 2));
7373
public static Transform3d robotToCamera2 =
7474
new Transform3d(
7575
Units.inchesToMeters(7.5),
@@ -129,19 +129,18 @@ public final class HopperConstants {
129129
}
130130

131131
public static class IntakeConstants {
132-
public static final int SPINTAKEID = 42;
133-
public static final int SPINTAKEID_KRAKEN = 43;
134-
public static final int DEPLOYID = 41;
132+
public static final int SPINTAKEID = 41;
133+
public static final int DEPLOYID = 42;
135134

136-
public static final double INTAKE_SPEED = 0.5;
137-
public static final double SPITAKE_SPEED = -0.5;
135+
public static final double INTAKE_SPEED = 1;
136+
public static final double SPITAKE_SPEED = -1;
138137
public static final double DEPLOY_SPEED = 1;
139-
public static final Angle DEPLOY_POSITION = Degrees.of(70);
138+
public static final Angle DEPLOY_POSITION = Degrees.of(70);
140139
public static final Angle READY_POSITION = Degrees.of(40);
141140
public static final Angle UP_POSITION = Degrees.of(0);
142141
public static final Angle DEPLOY_TOLERANCE = Degrees.of(5);
143142

144-
public static final double kP = 1; // 1.33;
143+
public static final double kP = 1;//1.33;
145144
public static final double kI = 0;
146145
public static final double kD = 7.84;
147146
public static final double DEPLOY_RATIO = 25;

src/main/java/frc/robot/Robot.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public class Robot extends LoggedRobot {
3030
Timer gcTimer = new Timer();
3131

3232
public Robot() {
33-
// super(0.04);
3433
gcTimer.start();
3534
// Record metadata
3635
Logger.recordMetadata("ProjectName", BuildConstants.MAVEN_NAME);
@@ -50,8 +49,8 @@ public Robot() {
5049
switch (Constants.currentMode) {
5150
case REAL:
5251
// Running on a real robot, log to a USB stick ("/U/logs")
53-
// Logger.addDataReceiver(new WPILOGWriter());
54-
// Logger.addDataReceiver(new NT4Publisher());
52+
Logger.addDataReceiver(new WPILOGWriter());
53+
Logger.addDataReceiver(new NT4Publisher());
5554
break;
5655

5756
case SIM:

0 commit comments

Comments
 (0)