Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static class constDrivetrain {
public static final AngularVelocity TURN_SPEED = Units.DegreesPerSecond.of(360);
public static final double SLOW_MODE_MULTIPLIER = 0.5;

public static final boolean INVERT_ROTATION = true;
public static final boolean INVERT_ROTATION = !Robot.isSimulation();

// -- Motor Configurations --
static {
Expand Down
20 changes: 14 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@ public RobotContainer() {
configOperatorBindings();
configAutos();

autoChooser.onChange(selectedAuto -> {
String pose = "default_pose"; // Initialize with a default value
if (selectedAuto == nonProcSide4Coral) {
pose = "top_ji";
} else if (selectedAuto == procSide4Coral) {
pose = "proc_ef";
} else if (selectedAuto == mid1Coral || selectedAuto == midAlgae) {
pose = "mid_gh";
}
autoFactory.resetOdometry(pose).ignoringDisable(true).schedule();
});

subDrivetrain.resetModulesToAbsolute();
}

Expand All @@ -247,7 +259,6 @@ public void configAutos() {
);

nonProcSide4Coral = Commands.sequence(
autoFactory.resetOdometry("top_ji").asProxy(),
ScoreAndCollect("top_ji", "ji_cs", REEF_AUTO_DRIVING_RIGHT,
TRY_PREP_CORAL_L4),
ScoreAndCollect("cs_lk", "lk_cs", REEF_AUTO_DRIVING_RIGHT,
Expand All @@ -257,7 +268,6 @@ public void configAutos() {
TRY_PREP_CORAL_L4));

procSide4Coral = Commands.sequence(
autoFactory.resetOdometry("proc_ef").asProxy(),
ScoreAndCollect("proc_ef", "ef_cs", REEF_AUTO_DRIVING_RIGHT,
TRY_PREP_CORAL_L4),
ScoreAndCollect("cs_cd", "cd_cs", REEF_AUTO_DRIVING_RIGHT,
Expand All @@ -267,19 +277,17 @@ public void configAutos() {
TRY_PREP_CORAL_L4));

mid1Coral = Commands.sequence(
autoFactory.resetOdometry("mid_gh").asProxy(),
Score("mid_gh", REEF_AUTO_DRIVING_LEFT, TRY_PREP_CORAL_L4));

midAlgae = Commands.sequence(
autoFactory.resetOdometry("mid_gh").asProxy(),
Score("mid_gh", REEF_AUTO_DRIVING_LEFT, TRY_PREP_CORAL_L4),
CleanAndScore("gh", "gh_net", TRY_CLEAN_LOW),
CleanAndScore("net_ji", "ji_net", TRY_CLEAN_HIGH),
CleanAndScore("net_ef", "ef_net", TRY_CLEAN_HIGH),
runPath("net_off_startingline").asProxy()); // FORGOT TO DO AS PROXY ON RUNPATH

autoChooser.setDefaultOption("4 Coral - Processor Side", procSide4Coral);
autoChooser.addOption("4 Coral - Non-Processor Side", nonProcSide4Coral);
autoChooser.addOption("4 Coral - Processor Side", procSide4Coral);
autoChooser.addOption("1 Coral - Mid", mid1Coral);
autoChooser.addOption("1 Algae - Mid", midAlgae);

Expand Down Expand Up @@ -329,7 +337,7 @@ Command CleanAndScore(String startPath, String endPath, Command try_clean_lv) {
}

Command runPath(String pathName) {
return autoFactory.trajectoryCmd(pathName)
return autoFactory.trajectoryCmd(pathName).asProxy()
.alongWith(Commands.runOnce(() -> subDriverStateMachine.setDriverState(DriverState.CHOREO)));
}

Expand Down