Skip to content

Commit d9c7e48

Browse files
committed
Pathplanner Auto Fixes
1 parent 8bbd5f6 commit d9c7e48

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ public static final class Settings {
264264
FLYWHEEL_SPEAKER_DISTANCE_LUT.put(0.0, 4000 / 60.0);
265265
FLYWHEEL_SPEAKER_DISTANCE_LUT.put(Units.feetToMeters(5), 4000 / 60.0);
266266
FLYWHEEL_SPEAKER_DISTANCE_LUT.put(
267-
Units.feetToMeters(10), Flywheel.Settings.BASE_SHOT_VELOCITY);
268-
FLYWHEEL_SPEAKER_DISTANCE_LUT.put(20.0, Flywheel.Settings.BASE_SHOT_VELOCITY);
267+
Units.feetToMeters(10), Flywheel.Settings.PARTIAL_SPINUP_VELOCITY);
268+
FLYWHEEL_SPEAKER_DISTANCE_LUT.put(20.0, Flywheel.Settings.PARTIAL_SPINUP_VELOCITY);
269269

270270
// ARM SPEAKER OFFSETS
271271
ORIGINAL_SPEAKER_LUT.put(0.0, 0.0);
@@ -274,7 +274,7 @@ public static final class Settings {
274274
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(14), Math.toRadians(3));
275275
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(16), Math.toRadians(4.5));
276276
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(18), Math.toRadians(5.5));
277-
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(20), Math.toRadians(8));
277+
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(20), Math.toRadians(7.75));
278278
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(22), Math.toRadians(9));
279279
ORIGINAL_SPEAKER_LUT.put(Units.feetToMeters(24), Math.toRadians(10));
280280
ORIGINAL_SPEAKER_LUT.put(100.0, Math.toRadians(10));
@@ -369,7 +369,7 @@ public static final class Settings {
369369

370370
public static final double POSITION_READY_TOLERANCE = 2 * (Math.PI / 180); // RAD
371371

372-
public static final double BASE_SHOT_POSITION = 55 * (Math.PI / 180); // RAD - Originally 59
372+
public static final double BASE_SHOT_POSITION = 55 * (Math.PI / 180); // RAD - originally 59
373373
public static final double AUTO_START_POSITION = 55 * (Math.PI / 180); // RAD
374374
public static final double AMP_POSITION = 50 * (Math.PI / 180); // RAD
375375
public static final double FULL_STOW_POSITION = 20.5 * (Math.PI / 180); // RAD
@@ -435,9 +435,9 @@ public static final class Hardware {
435435
}
436436

437437
public static final class Settings {
438-
public static final double BASE_SHOT_VELOCITY = 5520 / 60.0; // RPS
438+
public static final double BASE_SHOT_VELOCITY = 3970 / 60.0; // RPS
439439

440-
public static final double PARTIAL_SPINUP_VELOCITY = BASE_SHOT_VELOCITY / 1;
440+
public static final double PARTIAL_SPINUP_VELOCITY = 5520 / 60.0; // RPS
441441

442442
public static final double SPIN_UP_READY_TOLERANCE = 5; // RPS
443443

src/main/java/frc/robot/RobotContainer.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,10 @@ private Command ampSideSkip() {
906906
|| indexer.isProx2Active()));
907907
}
908908

909+
private Command pathPlannerCommand(){
910+
return autoChooser.get();
911+
}
912+
909913
private void configureTriggerBindings() {
910914

911915
controllerBindings.resetGyro().onTrue(drivetrain.resetFieldOrientedTele());
@@ -1176,17 +1180,12 @@ protected void onAutonomousStart() {
11761180
closeFourNoteDelay = delaySlider.getDouble(closeFourNoteDelay);
11771181

11781182
// get selected auto type, pathplanner or skip
1179-
Boolean pathplannerSelected = skipCommandChooser.getSelected().equals(new InstantCommand());
11801183

11811184
Command selectedAutoCommand;
11821185
String selectedAutoKey = "";
11831186

1184-
if (pathplannerSelected) {
1185-
selectedAutoCommand = autoChooser.get();
1186-
selectedAutoKey = autoChooser.getSendableChooser().getSelected();
1187-
} else {
1188-
selectedAutoCommand = skipCommandChooser.getSelected();
1189-
}
1187+
selectedAutoKey = autoChooser.getSendableChooser().getSelected();
1188+
selectedAutoCommand = skipCommandChooser.getSelected();
11901189

11911190
AtomicBoolean runningDelayPathfindAuto = new AtomicBoolean(false);
11921191

@@ -1328,7 +1327,7 @@ private void initializeShuffleboardTabs() {
13281327
ShuffleboardTab tuningTab = Shuffleboard.getTab(Constants.Controller.TUNE_SHUFFLEBOARD_TAB_ID);
13291328

13301329
// set up skipCommandChooser
1331-
skipCommandChooser.addOption("Pathplanner Route", new InstantCommand());
1330+
skipCommandChooser.addOption("Pathplanner Route", pathPlannerCommand());
13321331
skipCommandChooser.addOption("Far Side Skip", farSideSkip());
13331332
skipCommandChooser.addOption("Amp Side Skip", ampSideSkip());
13341333
skipCommandChooser.addOption("Bypass Skip", bypassSkip());

0 commit comments

Comments
 (0)