Files
FTC-Project-Gen/windows/generate-pose2d.bat
2026-01-21 08:00:25 -06:00

37 lines
847 B
Batchfile

@echo off
REM Generate Pose2d.java
setlocal
set "PROJECT_DIR=%~1"
(
echo package robot;
echo.
echo /**
echo * Simple 2D pose representation ^(x, y, heading^).
echo * Pure data class - no dependencies.
echo */
echo public class Pose2d {
echo public final double x;
echo public final double y;
echo public final double heading;
echo.
echo public Pose2d^(double x, double y, double heading^) {
echo this.x = x;
echo this.y = y;
echo this.heading = heading;
echo }
echo.
echo public Pose2d^(^) {
echo this^(0, 0, 0^);
echo }
echo.
echo @Override
echo public String toString^(^) {
echo return String.format^("Pose2d^(x=%%.2f, y=%%.2f, heading=%%.2f^)", x, y, heading^);
echo }
echo }
) > "%PROJECT_DIR%\src\main\java\robot\Pose2d.java"
endlocal
exit /b 0