From 05974fefe00955487380069072d7aef02c18286a Mon Sep 17 00:00:00 2001 From: erojasoficial-byte Date: Thu, 12 Mar 2026 22:27:47 -0500 Subject: [PATCH] Fix crash when running without --flight flag and Unicode crash on Windows - fly_embodied.py: fly_name was only assigned inside the `if args.flight` block but used unconditionally by the proboscis joint lookup. Added fly_name = fly.name before the proboscis section. - benchmark.py: replaced Unicode checkmark/cross (U+2713/U+2717) with ASCII "OK"/"FAIL" to prevent encoding crash on Windows consoles. --- code/benchmark.py | 2 +- fly_embodied.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/benchmark.py b/code/benchmark.py index e9a0258..9c54f51 100644 --- a/code/benchmark.py +++ b/code/benchmark.py @@ -217,7 +217,7 @@ def print_summary_table(all_results, backend_name, logger): for result in all_results: t = result.get('timings', {}) - status_icon = "\u2713" if result['status'] == 'success' else "\u2717" + status_icon = "OK" if result['status'] == 'success' else "FAIL" setup_time = t.get( 'network_creation_total', t.get('model_setup_total', 0) diff --git a/fly_embodied.py b/fly_embodied.py index 8d26f2f..138f2ae 100644 --- a/fly_embodied.py +++ b/fly_embodied.py @@ -429,6 +429,7 @@ def main(): # ── Find proboscis joint (added dynamically to Rostrum) ── model_ptr = sim.physics.model.ptr + fly_name = fly.name for jname_candidate in [f"{fly_name}/joint_Proboscis", "joint_Proboscis"]: proboscis_jnt_id = mujoco.mj_name2id( model_ptr, mujoco.mjtObj.mjOBJ_JOINT, jname_candidate)