Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

frc-2027-robot-starter

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.

Architectural rule

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.

Layout

.
├── 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

Prereqs

  • A sibling clone of pi5-system-surrogate, with its hal-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-surrogate if you don't keep them as siblings.

Build + deploy

./deploy.sh                   # build, stop old, start new
./stop.sh                     # halt the running robot
tail -f /tmp/robot.log        # watch its phase transitions

By 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.sh

Bumping the version

The 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.

systemd

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 robot

License

MIT for our code. See NOTICE.md for the WPILib-derived runtime libraries (BSD-3-Clause).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages