Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions src/main/java/frc/robot/Autos.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ public Autos(
LoggedNetworkTablesBuilder.createLoggedAutoResettingButton("Autos/Reset Odometry")
.onTrue(new InstantCommand(this::resetAutoOdometry).ignoringDisable(true)));

autoChooser.onChange(
(Auto auto) -> {
try {
// Construct this auto to warm up the JSON parser and get all the paths into
// PathPlanner's path cache.
PathPlannerAuto pp_auto = new PathPlannerAuto(auto.autoName);
DriverStation.reportWarning("Preloaded auto " + pp_auto.getName(), false);
} catch (Exception e) {
DriverStation.reportError("Error preloading auto " + auto.autoName, false);
}
});
bindNamedCommands();
bindEventMarkers();
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package frc.robot;

import com.pathplanner.lib.commands.FollowPathCommand;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.controls.Controls;
import frc.robot.generated.TunerConstants;
Expand Down Expand Up @@ -97,6 +98,7 @@ public RobotContainer() {
leds = new Leds(new LedsReal());
deploy = new Deploy(new DeployIO() {});
hood = new Hood(new HoodIOReal());

break;

case SIM:
Expand Down Expand Up @@ -156,6 +158,8 @@ public RobotContainer() {
controls =
new Controls(drive, intake, shooter, indexer, booster, hood, fuelDetection, leds, deploy);
autos = new Autos(drive, indexer, intake, shooter, booster, hood, leds, deploy);
// Warm up the PathPlaner system.
FollowPathCommand.warmupCommand();
}

public Command getAutonomousCommand() {
Expand Down
Loading