PathPlanner Named Commands Not Working

We’re trying to set up PathPlanner on our YAGSL swerve drive. We have paths running fine, but we can’t seem to get Named Commands to run from the GUI. We tested our “subsystem” (just a motor on a mount to test with) to make sure we didn’t have any issues making it spin in teleop. We also checked the PathPlanner documentation on Named Commands to make sure we were registering them in the correct spot, and we looked at the example project as well. We also tried placing the Named Command on an Event Marker to see if that would work. The motor still won’t spin in our auto routine.

Here’s our GitHub repo: https://github.com/2145-Hazmats/2024SwerveYAGSL

I don’t know the side effect of building your Auto chooser before you register the named commands, but I don’t know how the AutoBuilder will reason through the situation when a sequential command group is trying to use a command that doesn’t exist.

Your code instantiates the auto chooser before it registers the named commands.

Thank you! I moved the AutoChooser to be created after our NamedCommands, and I realized that our paths were being instantiated in the constructor for SwerveSubsystem, which was being called before our NamedCommands register functions. Changed where the constructor was called to be after the register functions, and it works!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.