Commit 929421d
committed
Fix Snap-to-EE segfault: dispatch to physics thread (#17)
The _on_snap callback ran on viser's websocket thread and called
arm.get_ee_pose() which accesses MuJoCo data (mj_forward +
site_xpos). Concurrent access from the wrong thread causes a
segfault.
Fix: dispatch the MuJoCo read through event_loop.run_on_physics_thread,
same pattern as _activate_teleop. Viser GUI updates (gizmo position)
are thread-safe and stay on the websocket thread.
Fixes ada_mj#171 parent 9f70e39 commit 929421d
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
302 | 308 | | |
303 | 309 | | |
304 | 310 | | |
| |||
0 commit comments