docs(readme): add full setup guide — SSH access, clone, overlay, build steps

Adds SSH key setup instructions for paje.ca, correct Gitea hostname
(git.paje.ca), step-by-step clone+overlay workflow, Unity batch build
command, DLL rsync note (Builds/ not Library/), and an update workflow
for pulling future script changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Huliganga 2026-05-15 10:44:04 -04:00
parent fcdcb14e57
commit 2be040216d
1 changed files with 79 additions and 23 deletions

102
README.md
View File

@ -1,7 +1,7 @@
# sdsandbox-rl-scripts # sdsandbox-rl-scripts
Modified C# scripts for the sdsandbox Unity simulator, used with the Modified C# scripts for the sdsandbox Unity simulator, used with the
[donkeycar-rl-autoresearch](https://paje.ca/git/paulh/donkeycar-rl-autoresearch) project. [donkeycar-rl-autoresearch](https://git.paje.ca/paulh/donkeycar-rl-autoresearch) RL training project.
## What's here ## What's here
@ -9,37 +9,93 @@ Modified C# scripts for the sdsandbox Unity simulator, used with the
- `ProjectSettings/` — Unity project settings - `ProjectSettings/` — Unity project settings
- `Packages/` — Unity package manifest - `Packages/` — Unity package manifest
Binary assets (textures, models, scenes) are **not** included here — they come from the
upstream sdsandbox repo. See **Setup** below.
## Key modifications (vs upstream tawnkramer/sdsandbox) ## Key modifications (vs upstream tawnkramer/sdsandbox)
- **`Car.cs`** — per-wheel OverlapSphere barrier collision detection; CCD mode - **`Car.cs`** — per-wheel OverlapSphere barrier collision detection; CCD tunneling prevention
- **`TcpCarHandler.cs`** — `regen_road` message support with direct RoadBuilder+PathManager fallback when no TrainingManager present; `set_ai_text` overlay message - **`TcpCarHandler.cs`** — `regen_road` TCP message with direct RoadBuilder+PathManager fallback
when no TrainingManager is present; `set_ai_text` overlay message; BrakeOnUpdate support
- **`PathManager.cs`** — self-intersection fix: retry loop with XZ segment-segment math (up to 20 retries) - **`PathManager.cs`** — self-intersection fix: retry loop with XZ segment-segment math (up to 20 retries)
- **`RoadBuilder.cs`** — BoxCollider per segment with overlap; `showBarrierMeshes` flag - **`RoadBuilder.cs`** — BoxCollider per segment with overlap to close corner gaps; `showBarrierMeshes` flag
- **`MapOverlay.cs`** — minimap refresh on road node position change (not just count) - **`MapOverlay.cs`** — minimap refreshes on road node position change (not just node count)
## Setup on a new machine ## Setup on a new machine
1. Clone the upstream sdsandbox (provides all binary assets Unity needs): ### Step 1 — SSH access to paje.ca (one-time)
```bash
git clone https://github.com/tawnkramer/sdsandbox
```
2. Clone this repo: Generate an SSH key if you don't have one:
```bash ```bash
git clone git@paje.ca:paulh/sdsandbox-rl-scripts.git ssh-keygen -t ed25519 -C "your-name@your-machine"
``` ```
3. Overlay our scripts into the sdsandbox project: Copy the public key:
```bash ```bash
cp -r sdsandbox-rl-scripts/Scripts/* sdsandbox/sdsim/Assets/Scripts/ cat ~/.ssh/id_ed25519.pub
cp -r sdsandbox-rl-scripts/ProjectSettings/* sdsandbox/sdsim/ProjectSettings/ ```
cp -r sdsandbox-rl-scripts/Packages/* sdsandbox/sdsim/Packages/
```
4. Open `sdsandbox/sdsim` in Unity 6000.4.4f1. Unity will reimport assets on first open. Add it to Gitea: log in at **https://git.paje.ca** → Settings → SSH / GPG Keys → Add Key.
5. Build: **Edit → Project Settings → Player Builder → WinBuild** (or use the batch build command from the donkeycar-rl-autoresearch SESSION_HANDOFF.md). Test it:
```bash
ssh -T git@paje.ca
# Expected: Hi there, paulh! You've successfully authenticated...
```
## Unity version ### Step 2 — Clone both repos
**Unity 6000.4.4f1** — other versions are not tested and may have incompatible APIs. Clone the upstream sdsandbox (provides all binary assets Unity needs):
```bash
git clone https://github.com/tawnkramer/sdsandbox
```
Clone this repo:
```bash
git clone git@paje.ca:paulh/sdsandbox-rl-scripts.git
```
### Step 3 — Overlay our scripts
```bash
cp -r sdsandbox-rl-scripts/Scripts/* sdsandbox/sdsim/Assets/Scripts/
cp -r sdsandbox-rl-scripts/ProjectSettings/* sdsandbox/sdsim/ProjectSettings/
cp -r sdsandbox-rl-scripts/Packages/* sdsandbox/sdsim/Packages/
```
### Step 4 — Open in Unity
Open `sdsandbox/sdsim` in **Unity 6000.4.4f1**. Unity will reimport assets on first open
(takes a few minutes).
Other Unity versions are not tested and may have incompatible APIs.
### Step 5 — Build the simulator
Run the batch build from WSL:
```bash
"/mnt/c/Program Files/Unity/Hub/Editor/6000.4.4f1/Editor/Unity.exe" \
-quit -batchmode \
-projectPath "C:/path/to/sdsandbox/sdsim" \
-executeMethod PlayerBuilder.WinBuild \
-logFile "C:/Users/YourName/AppData/Local/Temp/unity_rebuild.log"
```
Build output lands in `sdsim/Builds/DonkeySimWin/`. Copy the `Assembly-CSharp.dll`
from **that folder** (not `Library/ScriptAssemblies/`) to the runtime sim folder:
```bash
rsync -av "sdsim/Builds/DonkeySimWin/donkey_sim_Data/Managed/Assembly-CSharp.dll" \
"/path/to/DonkeySimWin/donkey_sim_Data/Managed/Assembly-CSharp.dll"
```
## Keeping scripts up to date
To pull the latest script changes onto an existing sdsandbox clone:
```bash
cd sdsandbox-rl-scripts && git pull
cp -r Scripts/* ../sdsandbox/sdsim/Assets/Scripts/
cp -r ProjectSettings/* ../sdsandbox/sdsim/ProjectSettings/
cp -r Packages/* ../sdsandbox/sdsim/Packages/
```
Then rebuild in Unity (Step 5 above).