Java2PedroPathing converts FTC autonomous Java source into JSON that can be opened in the Pedro Pathing visualizer.
- Python 3.9 or newer
- An FTC autonomous Java file using the supported
Pose,Path,BezierLine,buildPath,FollowPath, andDelaypatterns shown inexamples/andsamples/
The converter uses Python's standard library and has no runtime dependencies.
Run directly from a clone:
python pathing_tool.py --helpOr install the command locally:
python -m pip install .
java2pedro-pathing --helpjava2pedro-pathing \
--input examples/ANewWorkingAuto.java \
--output blue_far_pathing.json \
--alliance blue \
--location farAvailable options:
--alliance {blue,red}selects the alliance and mirrors blue poses for red.--location {far,close}selects the starting and general scoring poses.--force-close-score1uses the close scoring pose forscorePose1.--start-close-skip-farusestargetExitPosCloseBluefor a close start.- Use
--input -to read Java source from standard input.
pathing_tool.py: supported converter and command-line entry pointexamples/: primary example inputsamples/: additional supported source patterns and generated outputsblue_far_pathing.json: generated output for the primary examplePathingFileGenerator.java: legacy, fixed Blue/Far JSON generatortests/: checks that committed generated artifacts remain reproducible
python pathing_tool.py --input examples/ANewWorkingAuto.java --output blue_far_pathing.json --alliance blue --location far
python pathing_tool.py --input samples/provided_working_code.java --output samples/provided_blue_far.json --alliance blue --location far
python pathing_tool.py --input samples/updated_auto.java --output samples/updated_blue_far.json --alliance blue --location farRun the test suite before publishing changes:
python -m unittest discover -vBuild distributable Python artifacts:
python -m buildPathingFileGenerator.java uses text blocks and records, so it requires Java
16 or newer to compile. It is retained as a legacy fixed-output example; the
Python converter is the supported tool.