# Gubi Labs Academy simulation exercises

These programs only run local simulations, inspect files, or exercise a fake interface. They have no motor/CAN/serial command path. A successful result does not validate real hardware.

Save the downloads together in a folder called course-labs. Install Python 3.12. On macOS/Linux, open a Terminal in that folder:

```sh
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-academy.txt
python hinge_lab.py --out baseline.csv
python plot_run.py baseline.csv --out baseline.png
python commissioning_mock.py
```

On Windows, create the environment with `py -3.12 -m venv .venv`, then use `.venv\Scripts\python.exe` instead of `python`; activation is optional. That avoids changing PowerShell execution policy.

The hinge viewer on macOS uses `mjpython hinge_lab.py --viewer`. On other supported platforms use `python hinge_lab.py --viewer`. A graphics-window failure is separate from numerical simulation; run without --viewer first.

Acquire the original Deploy sources separately:

```sh
git clone https://github.com/KaydenKnapik/BDX-R-Deploy.git
git -C BDX-R-Deploy checkout d4f3671a44f8ca2c02e31b23607aa8d7fdc076a3
python inspect_robot.py BDX-R-Deploy/xml/bdxr.xml
python inspect_policy.py BDX-R-Deploy/models/new.onnx
python walk_lab.py --deploy BDX-R-Deploy --out runs/baseline
python plot_run.py runs/baseline.csv --out runs/baseline.png
```

`walk_lab.py` uses the upstream config loader and simulation backend, which configures the actuators as position control. It intentionally does not instantiate the keyboard runner or hardware backend. It supplies the most recently applied policy action in the next observation. `--history upstream` reproduces the older action-history ordering for comparison. Preserve the reference checkout and identify changes explicitly.

The default walking sequence lasts 50 seconds: stand 0–5 s, forward 0.2 m/s 5–15 s, stop 15–25 s, backward −0.2 m/s 25–35 s, forward 0.1 m/s with yaw 0.3 rad/s 35–45 s, stop 45–50 s. The source audit's older --demo option is different; this course uses its own explicit sequence.

Use unique output names. Example constant-command experiment:

```sh
python walk_lab.py --deploy BDX-R-Deploy --command -0.1 0 0 --seconds 30 --out runs/backward-small
```

For an optional live walking window, add --viewer and use mjpython on macOS. Closing it exits. This runner has scripted commands, not a keyboard teleoperation interface. Read the program before changing it. The 60-degree numeric tilt stop is a simulation test termination, not an approved physical safety threshold.

Dependencies are pinned for the demonstrated MuJoCo/ONNX path. NumPy, Matplotlib and PyYAML have compatible ranges; record `python -m pip freeze > environment.txt` for each experiment environment. Do not copy virtual environments between machines.
