c528dd268f
Include callable skill and live-GUI prerequisites, epoch sensor reads, packed snapshots, sampled bit-exact kinematics, and verified-tick rendering without changing the physical/control schedule. Record bounded analytic S1 GUI/headless qualification, original failures and CPU evidence (1557 passed, 6 skipped). Preserve accepted_skill=false and sub-real-time limitations. Exclude native authorities, caches, large media and local delivery copies; retain sealed artifact digest.
57 lines
2.1 KiB
Python
57 lines
2.1 KiB
Python
#!/usr/bin/python3.12
|
|
"""Real supervised simulation through the public API; no Kit import in caller.
|
|
|
|
Run from a same-layout independent skill package. Creates a fresh bounded session
|
|
and external run directory. Commands are queued live, not a fixed shell replay.
|
|
"""
|
|
import json
|
|
from pathlib import Path
|
|
import sys
|
|
import tempfile
|
|
import time
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(ROOT))
|
|
from scripts.go2_fl_skill import start
|
|
from scripts.skill_launch_v4 import new_registration
|
|
|
|
|
|
def main():
|
|
output = Path(tempfile.mkdtemp(prefix='go2-fl-python-'))
|
|
registration = output / 'session/registration.json'
|
|
new_registration(registration) # Explicit new caller authorization, no GPU/Kit yet.
|
|
run = start(output / 'run', registration, command='x_bias-16mm', cycles=6)
|
|
print('Real simulation and evidence:', output, flush=True)
|
|
deadline = time.monotonic() + 1500
|
|
|
|
def wait_status(predicate):
|
|
while time.monotonic() < deadline:
|
|
status = run.query()
|
|
if status['state'] == 'failed':
|
|
raise RuntimeError(status)
|
|
if predicate(status):
|
|
return status
|
|
if run.process.poll() is not None:
|
|
raise RuntimeError('Supervisor ended before requested status')
|
|
time.sleep(.25)
|
|
raise TimeoutError('Caller status deadline; supervisor retains its own bounded cleanup')
|
|
|
|
wait_status(lambda status: status['state'] == 'running')
|
|
for command in ('baseline_direction-24mm', 'y_bias-16mm'):
|
|
request_id = run.queue(command)
|
|
status = wait_status(lambda value: (value.get('last_receipt') or {}).get('request', {}).get('id') == request_id)
|
|
assert status['last_receipt']['accepted']
|
|
try:
|
|
run.queue('INVALID')
|
|
except ValueError:
|
|
print('Invalid command rejected before publication', flush=True)
|
|
wait_status(lambda status: status.get('global_tick', 0) >= 23000)
|
|
run.request_stop() # Finish current sixth cycle; not arbitrary-phase hard stop.
|
|
code = run.wait()
|
|
print(json.dumps(run.query(), indent=2))
|
|
return code
|
|
|
|
|
|
if __name__ == '__main__':
|
|
raise SystemExit(main())
|