Skip to content

fix(unitree): marshal stop_movement zero-twist onto the loop thread#2977

Merged
spomichter merged 1 commit into
mainfrom
ruthwik/fix/stopmovement
Jul 15, 2026
Merged

fix(unitree): marshal stop_movement zero-twist onto the loop thread#2977
spomichter merged 1 commit into
mainfrom
ruthwik/fix/stopmovement

Conversation

@ruthwikdasyam

@ruthwikdasyam ruthwikdasyam commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

stop_movement called _publish_movement(0,0,0) directly from non-loop threads

Solution

Marshal the send onto the connection's event loop via asyncio.run_coroutine_threadsafe, matching the existing pattern in publish_request and move().

How to Test

dimos run teleop-hosted-go2-multicam

Contributor License Agreement

  • I have read and approved the CLA.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves the Unitree stop command onto the connection event loop.

  • Wraps the zero-twist publish in a coroutine.
  • Schedules it with run_coroutine_threadsafe.
  • Logs failures while dispatching the stop command.

Confidence Score: 5/5

The event-loop-thread stop path can delay the zero-twist command.

  • External-thread callers now use the connection event loop.
  • A call made from that same loop waits for work that cannot run until the wait ends.

dimos/robot/unitree/connection.py

Important Files Changed

Filename Overview
dimos/robot/unitree/connection.py Routes stop_movement through the Unitree connection event loop and adds dispatch failure logging.

Reviews (1): Last reviewed commit: "fix(unitree): marshal stop_movement zero..." | Re-trigger Greptile

Comment thread dimos/robot/unitree/connection.py
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/robot/unitree/connection.py 50.00% 3 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main    #2977      +/-   ##
==========================================
- Coverage   72.17%   71.91%   -0.27%     
==========================================
  Files        1020     1021       +1     
  Lines       91664    91810     +146     
  Branches     8375     8414      +39     
==========================================
- Hits        66163    66025     -138     
- Misses      23267    23563     +296     
+ Partials     2234     2222      -12     
Flag Coverage Δ
OS-ubuntu-24.04-arm 65.15% <50.00%> (+0.07%) ⬆️
OS-ubuntu-latest 67.50% <50.00%> (+0.07%) ⬆️
Py-3.10 67.49% <50.00%> (+0.08%) ⬆️
Py-3.11 67.48% <50.00%> (+0.06%) ⬆️
Py-3.12 ?
Py-3.13 67.49% <50.00%> (+0.07%) ⬆️
Py-3.14 67.50% <50.00%> (+0.07%) ⬆️
Py-3.14t ?
SelfHosted-macOS ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/robot/unitree/connection.py 57.25% <50.00%> (-0.40%) ⬇️

... and 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spomichter
spomichter merged commit 96d2e9a into main Jul 15, 2026
33 of 50 checks passed
@spomichter
spomichter deleted the ruthwik/fix/stopmovement branch July 15, 2026 18:50
Nabla7 added a commit that referenced this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants