From ca5e1e46d517fb256917873fdab72915881b594b Mon Sep 17 00:00:00 2001 From: awdev <165525907+awdev1@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:22:25 -0700 Subject: [PATCH 1/3] feat: add HMR with Sloth --- .idea/runConfigurations/deploySloth.xml | 20 ++++++++++++++++++++ TeamCode/build.gradle | 11 +++++++++++ build.dependencies.gradle | 4 +++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .idea/runConfigurations/deploySloth.xml diff --git a/.idea/runConfigurations/deploySloth.xml b/.idea/runConfigurations/deploySloth.xml new file mode 100644 index 0000000..682ddad --- /dev/null +++ b/.idea/runConfigurations/deploySloth.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/TeamCode/build.gradle b/TeamCode/build.gradle index 4b84337..8fc79c9 100644 --- a/TeamCode/build.gradle +++ b/TeamCode/build.gradle @@ -11,9 +11,20 @@ // Custom definitions may go here +buildscript { + repositories { + mavenCentral() + maven { url "https://repo.dairy.foundation/releases" } + } + dependencies { + classpath "dev.frozenmilk:Load:0.2.4" + } +} + // Include common definitions from above. apply from: '../build.common.gradle' apply from: '../build.dependencies.gradle' +apply plugin: 'dev.frozenmilk.sinister.sloth.load' android { namespace = 'org.firstinspires.ftc.teamcode' diff --git a/build.dependencies.gradle b/build.dependencies.gradle index 44eb5fc..06a8fdd 100644 --- a/build.dependencies.gradle +++ b/build.dependencies.gradle @@ -2,6 +2,7 @@ repositories { mavenCentral() google() // Needed for androidx maven { url = "https://mymaven.bylazar.com/releases" } + maven { url = "https://repo.dairy.foundation/releases" } } dependencies { @@ -17,6 +18,7 @@ dependencies { implementation 'com.pedropathing:ftc:2.0.5' implementation 'com.pedropathing:telemetry:1.0.0' - implementation 'com.bylazar:fullpanels:1.0.9' + implementation 'com.bylazar.sloth:fullpanels:0.2.4+1.0.12' + implementation 'dev.frozenmilk.sinister:Sloth:0.2.4' } From 89b3332e8184aea2c773fee4505b27a2bef871d0 Mon Sep 17 00:00:00 2001 From: awdev <165525907+awdev1@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:30:39 -0700 Subject: [PATCH 2/3] chore: add sloth to the docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 94daf70..14a054b 100644 --- a/README.md +++ b/README.md @@ -318,4 +318,5 @@ Mirrors the Blue auto using coordinate flipping (`flipX` / `flipHeading` helpers 3. Verify all hardware config names match the [Hardware Map](#hardware-map) table above. 4. Run `Tuning` OpMode to verify PedroPathing constants for the current robot. 5. Run `MotifScannerAuto` in pre-match to detect and store the motif pattern before running teleop. +6. Optionally use sloth for faster deploys to the robot 6. For competition matches, run the appropriate auto first, then select the matching alliance teleop — pose is automatically transferred via `PoseStorage`. From 528231338915d4f162a5405a67f80ecdbdcb3c83 Mon Sep 17 00:00:00 2001 From: awdev <165525907+awdev1@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:38:16 -0700 Subject: [PATCH 3/3] chore: add more sloth to the docs --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14a054b..bc69042 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ FTC robot controller code for **VC Silver Circuits (Team 16158)** for the 2025-2 - [Teleop Controls](#teleop-controls) - [Autonomous Sequences](#autonomous-sequences) - [Tuning Parameters](#tuning-parameters) +- [Hot Reload with Sloth](#hot-reload-with-sloth) --- @@ -318,5 +319,30 @@ Mirrors the Blue auto using coordinate flipping (`flipX` / `flipHeading` helpers 3. Verify all hardware config names match the [Hardware Map](#hardware-map) table above. 4. Run `Tuning` OpMode to verify PedroPathing constants for the current robot. 5. Run `MotifScannerAuto` in pre-match to detect and store the motif pattern before running teleop. -6. Optionally use sloth for faster deploys to the robot 6. For competition matches, run the appropriate auto first, then select the matching alliance teleop — pose is automatically transferred via `PoseStorage`. + +--- + +## Hot Reload with Sloth + +This project uses [Sloth](https://github.com/Dairy-Foundation/Sloth) for hot code reloading. Instead of a full 40+ second APK install, Sloth pushes only changed TeamCode classes to the robot in under 2 seconds. + +### Daily workflow + +1. Make code changes in `TeamCode` +2. Run the **`deploySloth`** run configuration in Android Studio +3. Restart the OpMode on the Driver Hub — changes are live immediately + +### Full install (required when) + +- Adding or updating library dependencies +- Modifying files outside of `TeamCode` (e.g. `build.gradle`, `FtcRobotController`) +- First-time setup on a new robot + +For a full install, run `removeSlothRemote` first (added as a "Before launch" step in the TeamCode run config), then do a normal build & deploy. + +### Notes + +- Only classes under `org.firstinspires.ftc.teamcode` are hot-reloaded +- Classes annotated with `@Pinned` are excluded from hot reload and always require a full install +- Sloth changes survive robot restarts and power cycles