PathPlanner paths not being loaded correctly

We are trying to use the PathPlanner.loadpath method but it dosen’t seem to be working correctly. The only way we’ve gotten it to not throw a null is by giving the path name of “New Path”. This always runs the default path when you make a new path in the gui. Does anyone know why this happens and how to fix it? I can send pics of code if needed. Thank you in advance

Yes, please share your code. Ideally as a link to github (or similar).

If you’re unable to share code for some kind of team privacy reason, please create a new project and only add what’s necessary to reproduce the issue you’re seeing so we can reference that.

Do you get an error message? We had a permissions issue on the roboRIO and it was failing to load the path. It spit out a permission denied error in the RioLog. The solution was to ssh to the rio and change the folder permissions.

here is the github in question: GitHub - FRC4418/2023_ChargedUp at auto_test

And here is the error message its giving me:

ERROR  1  Unhandled exception: java.lang.NullPointerException: Cannot read field “fromGUI” because “trajectory” is null  com.pathplanner.lib.commands.PPRamseteCommand.(PPRamseteCommand.java:99)

Trajectory is the first parameter in the PPRamseteCommand

I would double check the name of the path you are trying to load. It your error message says you are trying to load the path named “fromGUI” when you only have “NewPath”, “Path2”, and “StraightPath” as valid path names in the deploy/pathplanner folder

Edit: After checking my teams code, I noticed that you had nested deploy folders
(src/main/deploy/deploy/pathplanner)
which may be causing issues as well. I didn’t see anything in your code trying to load a path named “fromGUI” so my above advice may be incorrect.

fromGUI is just a boolean in the path object used to determine whether a path should be mirrored for the red alliance or not. Its getting a null pointer exception since the path is null since it is failing to load.

Nested deploy directories would definately do it. @MrPresident it looks like you opened the deploy directory in pathplanner instead of the root directory of the project. Open the 2023_ChargedUp folder in pathplanner and it should put everything in the right spot.

2 Likes

Thank you, I’ll try this and mark a solution

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