Pathplanner AutoBuilder Event Exception

Good evening from team 564!

We have just generated our Swerve Project using Tuner X, and have starting implemented PathPlanner.

We’re currently running into an issue that’s got us stumped.
Whenever we call AutoBuilder.buildAutoChooser() or AutoBuilder.buildAuto() we get the following exception:

Error at com.pathplanner.lib.commands.FollowPathCommand.<init>(FollowPathCommand.java:86): Unhandled exception: java.lang.NoSuchMethodError: 'void com.pathplanner.lib.commands.FollowPathCommand.addRequirements(java.util.Collection)'
        at com.pathplanner.lib.commands.FollowPathCommand.<init>(FollowPathCommand.java:86)
        at com.pathplanner.lib.auto.AutoBuilder.lambda$configure$0(AutoBuilder.java:78)
        at com.pathplanner.lib.auto.AutoBuilder.followPath(AutoBuilder.java:257)
        at com.pathplanner.lib.auto.CommandUtil.pathCommandFromData(CommandUtil.java:79)
        at com.pathplanner.lib.auto.CommandUtil.commandFromJson(CommandUtil.java:46)
        at com.pathplanner.lib.auto.CommandUtil.sequentialGroupFromData(CommandUtil.java:87)
        at com.pathplanner.lib.auto.CommandUtil.commandFromJson(CommandUtil.java:47)
        at com.pathplanner.lib.commands.PathPlannerAuto.initFromJson(PathPlannerAuto.java:455)
        at com.pathplanner.lib.commands.PathPlannerAuto.<init>(PathPlannerAuto.java:85)
        at com.pathplanner.lib.auto.AutoBuilder.buildAutoChooserWithOptionsModifier(AutoBuilder.java:432)
        at com.pathplanner.lib.auto.AutoBuilder.buildAutoChooser(AutoBuilder.java:391)
        at com.pathplanner.lib.auto.AutoBuilder.buildAutoChooser(AutoBuilder.java:379)
        at frc.robot.RobotContainer.<init>(RobotContainer.java:57)
        at frc.robot.Robot.robotInit(Robot.java:18)
        at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:107)
        at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:365)
        at edu.wpi.first.wpilibj.RobotBase.lambda$startRobot$0(RobotBase.java:433)
        at java.base/java.lang.Thread.run(Thread.java:833)

Here’s our code Repository

My current theory is that I’m setting up the AutoBuilder incorrectly, but I should mention that we had to mess with PathplannerLib-beta.json to get it running, so It could be that too.

Any and all help is greatly appreciated!

What version of WPILib are you running?

If you have a FollowPathCommand in your code, maybe look there?

I would recommend configuring autobuilder by looking at how other succesful teams did it. For example, I used AdvantageKit’s Advanced Swerve Drive example which has Autobuilder fully configured (and working) in Drive.java.

I hope this helps!

I looked at your repo and saw that you are using the 2024 version of WPILib.
You will need to be on the WPILib 2025 beta to use the latest beta version of PathPlannerLib. If you decide to upgrade your WPILib, you might as well regenerate your robot project using Phoenix Tuner X Preview. I would also recommend referencing the CTRE Swerve PathPlanner example: Phoenix6-Examples/java/SwerveWithPathPlanner at main · CrossTheRoadElec/Phoenix6-Examples · GitHub (you can look at the git history to see the 2024 version).

I’m guessing the modification you made to the vendordep json was to change “frcYear” to “2024” in the json. This will cause issues, as the latest PathPlanner beta is built against the 2025 WPILib library, and so it’s trying to call methods that are only present in 2025 WPILib.

If you want to stay on 2024 WPILib, you will need to install the non-beta version of PathPlanner. Also, you can access the 2024 PathPlannerLib documentation using the wayback machine.

Alternatively, if you still want to use the PathPlanner beta, you can try replacing the vendordep JSON with an earlier beta that uses 2024 WPILib (https://raw.githubusercontent.com/3015RangerRobotics/3015RangerRobotics.github.io/0231af689a4cfe1a48f6c295f9140bececf7e7a2/pathplannerlib/PathplannerLib-beta.json). This is probably a bad idea, as you will get no more bugfixes, and modifying vendor dependencies can cause issues in general. I’m not sure whether this will actually work.

1 Like

Yup that was it, thanks for the help!