Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
also add web-dist to regen the balancebot demo
  • Loading branch information
gbin committed Mar 9, 2026
commit 2bd580d5e1d07b04c04b1dcffca0337e112bf9ee
10 changes: 10 additions & 0 deletions examples/cu_rp_balancebot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ $ just web
This serves the Bevy sim and the live Copper monitor through Trunk. The first run downloads the scene assets into `assets/` so the browser can load them from the same origin.
The browser path now uses the same asset filenames as the native sim: `balancebot.glb`, `skybox.ktx2`, and `diffuse_map.ktx2`.

## To build a static browser bundle

```bash
$ cd examples/cu_rp_balancebot
$ just web-dist
```

This writes a relocatable static Trunk bundle into `dist/` with stable filenames.

## To run the resimulation

(you need at least a log in `logs` for example from a simulation run).
Expand Down Expand Up @@ -77,6 +86,7 @@ $ cargo run --bin balancebot-logreader --release

- `just bevy` — run the split-view Bevy sim with `cu_bevymon`.
- `just web` — serve the split-view wasm demo with Trunk.
- `just web-dist` — build a deployable static wasm bundle into `dist/`.
- `just balancebot-dump-text-logs` — extract human-readable logs from `logs/balance.copper` into `../../target/debug/cu29_log_index/strings.bin`.
- `just balancebot-fsck` — integrity check of `logs/balance.copper`.
- `just balancebot-set-pwm-permissions` — fix PWM sysfs permissions on the target (requires appropriate privileges).
Expand Down
17 changes: 17 additions & 0 deletions examples/cu_rp_balancebot/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ web:
just prepare-assets
trunk serve --open

# Build a static browser bundle into dist/ with stable filenames.
web-dist:
#!/usr/bin/env bash
set -euo pipefail
if ! command -v trunk >/dev/null 2>&1; then
echo "Missing trunk. Install with: cargo install --locked trunk" >&2
exit 1
fi
cd "{{invocation_directory()}}"
just prepare-assets
rm -rf dist
trunk build --release --public-url ./ --filehash false --dist dist
# Trunk 0.17 emits /./asset paths here; normalize them so the dist tree is
# relocatable and can be served from any subdirectory.
sed -i 's#/\./#./#g' dist/index.html
echo "Static web bundle written to ${PWD}/dist"

# Extract a text log using the balancebot logreader.
text-logs:
#!/usr/bin/env bash
Expand Down
Loading