Minimal "robot" project that connects to the
pi5-system-surrogate daemon
over NT4, decodes the current match phase from ControlData, and reports
it on /robot/status.
Not a full WPILib TimedRobot — this is a starter scaffold whose
purpose is to exercise the deploy → reload → match-phase loop end-to-end
against the pi5-system-surrogate platform. Fork it as your team's robot
repo; swap Robot.java for real subsystems as you build them up.
This robot contains zero match-phase timing. Phase durations
(autonomous, teleop, the 3-second pause) are owned by the daemon — the
DS analog. The robot is purely event-driven: inst.addListener(...) on
/Netcomm/Control/ControlData reacts to whatever the daemon publishes.
If you find yourself writing a clock or a Thread.sleep in robot code,
push that logic to the daemon side.
.
├── build.gradle.kts depends on locally-built ntcore + wpiutil jars
├── settings.gradle.kts
├── gradlew wrapper (Gradle 9.4.1)
├── src/main/java/Robot.java
├── deploy.sh build → stop old → copy jar → start new
├── stop.sh halt the running robot
└── robot.service systemd unit for production deploys
- A sibling clone of
pi5-system-surrogate, with itshal-port/Gradle build already produced (run./hal-port/build.sh :ntcore:jar :wpiutil:jar :ntcore:ntcoreJNISharedReleaseSharedLibrary :wpiutil:wpiutilJNISharedReleaseSharedLibrary -Ponlylinuxsystemcore). - JDK 25 on
PATH. - Override the location with
PI5_SURROGATE_ROOT=/path/to/pi5-system-surrogateif you don't keep them as siblings.
./deploy.sh # build, stop old, start new
./stop.sh # halt the running robot
tail -f /tmp/robot.log # watch its phase transitionsBy default the deployed jar lands at ~/robot/robot-all.jar and the
process pid lives in /tmp/robot.pid. Override:
DEPLOY_DIR=/opt/robot LOG_FILE=/var/log/robot.log ./deploy.shThe Robot.VERSION constant in
src/main/java/Robot.java is what the
deploy/reload integration test asserts on. Change it, redeploy, observe
that /robot/version reflects the new value — proof that fresh code is
running, not an older binary.
robot.service is the production analog of deploy.sh
on a Pi/SystemCore: After=pi5-system-surrogate.service,
Requires=pi5-system-surrogate.service, restart on failure, memory cap.
Install with:
sudo cp robot.service /etc/systemd/system/
sudo cp build/libs/robot-all.jar /opt/robot/robot-all.jar
sudo systemctl daemon-reload && sudo systemctl enable --now robotMIT for our code. See NOTICE.md for the WPILib-derived runtime libraries (BSD-3-Clause).