From 18831b4ee6a91a357039feed9410f4c4b7eb889e Mon Sep 17 00:00:00 2001 From: Technologyman00 Date: Tue, 22 Oct 2024 21:40:03 -0500 Subject: [PATCH] Add Warmup for Pathfinding Pathplanner pathfinding should preload to prevent delay of first attempt of pathfinding. --- .../frc/robot/subsystems/swervedrive/SwerveSubsystem.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java b/src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java index 7a109ced..785f2ba7 100644 --- a/src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java @@ -13,6 +13,7 @@ import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.commands.PathPlannerAuto; +import com.pathplanner.lib.commands.PathfindingCommand; import com.pathplanner.lib.path.PathConstraints; import com.pathplanner.lib.path.PathPlannerPath; import com.pathplanner.lib.util.HolonomicPathFollowerConfig; @@ -182,6 +183,10 @@ public void setupPathPlanner() }, this // Reference to this subsystem to set requirements ); + + //Preload PathPlanner Path finding + // IF USING CUSTOM PATHFINDER ADD BEFORE THIS LINE + PathfindingCommand.warmupCommand().schedule(); } /**