Windows support included
This commit is contained in:
37
windows/generate-pose2d.bat
Normal file
37
windows/generate-pose2d.bat
Normal file
@@ -0,0 +1,37 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user