Repository navigation
fix(teleop): run the keyboard teleop window in a child process on macOS - #4950
Conversation
KeyboardTeleopModule failed on macOS in two ways: it forced SDL's X11 driver, which macOS lacks, and it opened its pygame window from a worker thread, which Cocoa rejects with an NSException that kills the worker. Force X11 only on Linux. On macOS, run the existing _pygame_loop in a child process (this module run with -m), where it owns the main thread, and publish the commands it prints. Linux keeps the thread unchanged.
There was a problem hiding this comment.
go2 replay realtime (arm64)
Details
| Benchmark suite | Current: b16b012 | Previous: 1505f35 | Ratio |
|---|---|---|---|
peak memory |
1735.781 MB |
1735.602 MB |
1.00 |
peak threads |
374 threads |
372 threads |
1.01 |
network (transport) |
2728.404 MB |
2728.511 MB |
1.00 |
disk write |
1.742 MB |
1.898 MB |
0.92 |
instructions |
138.085 G |
136.483 G |
1.01 |
This comment was automatically generated by workflow using github-action-benchmark.
[Medium impact] The change reaches macOS users of a shared keyboard teleop feature. The subprocess-cleanup requirement must be satisfied before merging. The separate regression-test gap is non-blocking. FindingsSummaryMoves the macOS keyboard window into a child process so pygame runs on its main thread.
Reviews (1) · Last reviewed commit: "fix(teleop): run the keyboard teleop win..." · Reviewed by Greptile |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #4950 +/- ##
==========================================
- Coverage 83.15% 82.90% -0.26%
==========================================
Files 1743 1743
Lines 167653 167684 +31
Branches 13870 13877 +7
==========================================
- Hits 139418 139014 -404
- Misses 24485 24905 +420
- Partials 3750 3765 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 34 files with indirect coverage changes 🚀 New features to boost your workflow:
|
What is this feature?
KeyboardTeleopModulenow works on macOS._pygame_loopruns unchanged in a child process: the module re-runs itself withpython -m, and publishes thetwist/gripperlines that process prints.Why do we need this?
On macOS the module failed in two ways:
x11 not available).NSException.As a result, every arm
keyboard-teleop-*blueprint was unusable on Mac.How to Test
On macOS:
dimos run keyboard-teleop-xarm7
Uses mock hardware. Click the Keyboard Teleop window and hold W/A/S/D/Q/E; the arm moves in Viser (http://127.0.0.1:8095) and stops on release.
Checklist