Can not Import Pathweaver JSON file to WPILIB

Looked through the Trajectory docs but still having some issues when attempting to read the JSON file provided by Path Weaver. I can create and follow a trajectory just fine, just have issues reading the path Weaver JSON file.
Here is my code…


The error I receive when I switch to autonomous mode in simulation

What does your src/main/deploy directory look like?

Based on the path specified in your robot code, you need to put the JSON file at src/main/deploy/paths/Work.wpilib.json in your project. Hopefully, GradleRIO deploy handles nested files/folders.

Probably a path problem as mentioned above, but ex.getMessage() may provide additional information.

Yup it is, posted a screenshot below

2 Likes

What is the extension of the file?

Hmmm… interesting its not a JSON file. I assumed it would be as I got the file from PathWeaver

Paths capitalization is inconsistent between the code and the real directory name (I’m not sure if Windows cares…). Additionally, as stated before it’s a regular file.

Windows does not seem to care as this inconsistency is found throughout other teams code. However, why is the Pathweaver file a basic type and not a JSON?

No idea, our team uses 3015’s PathPlanner so I have no PathWeaver experience. Ask @calcmogul

It seems the file generated from PathWeaver itself is a file type and not type JSON, any idea why this may be?

Windows’s NTFS doesn’t care, but the Linux filesystem on the roboRIO does.

I don’t use PathWeaver either. I can’t even compile it on my machine, let alone use a pre-built version due to the libjpeg ABI required by JavaFX being too old.

From an IT security perspective, I suggest configuring Windows Explorer to always show file extensions if you haven’t already. It also makes issues like this easier to spot. The checkbox for it is in the View tab of the ribbon, iirc.

If you made the paths in pathweaver did you click on the paths and clicked build paths? Doing that would make the paths a json file within the deploy folder and make its own folder within that stores all the paths that you build

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