Skip to content

unitree-go2 efficiency review - #3272

Merged
leshy merged 19 commits into
mainfrom
ivan/feat/go2obs
Jul 30, 2026
Merged

unitree-go2 efficiency review#3272
leshy merged 19 commits into
mainfrom
ivan/feat/go2obs

Conversation

@leshy

@leshy leshy commented Jul 29, 2026

Copy link
Copy Markdown
Member

Main go2 is not amazing, my laptop thermally throttles eventually and then this explodes to load 50

2026-07-29_19-00

This branch fixes it:

2026-07-29_18-56 2026-07-29_18-55_1
  • reconfigured a bunch of libs to limit number of threads (they normally enumerate cpu N to create a pool, but their imports leaked and would create a pool before forking, which quickly oversubscribes the system, number of total threads in dimos was 1k+

  • added a test to forbid non-inline imports of o3d, opencv, rerun (random rerun import alone before forking was 800 threads)

  • fixed zenoh autodiscovery blockage, by default running local only

  • added zenoh system configurator for (previusly failing) implicit SHM transport

  • not important but added a more efficient cpu only voxelizer (4x worse, not 20x worse then cuda, like previously)

leshy added 8 commits July 29, 2026 14:26
…couting

Sessions relied purely on multicast scouting to find the robot, and many
APs filter multicast between WiFi clients: the Go2's go2web bridge sat
reachable on tcp/7447 while every scout went unanswered. go2web listens
on 0.0.0.0:7447 exactly for this case — dimos just never dialed in.

ZenohConfig.connect now defaults to tcp/<robot_ip>:7447 (plus any
--robot-ips) when the transport is zenoh. Scouting stays on for
everything else, an explicit connect override still wins, and an IP
carrying its own :port is used as given.

(cherry picked from commit 735adcb)
cv2/open3d/rerun are now imported inside the functions that use them (or
under TYPE_CHECKING for annotations only) across all 63 grandfathered
files, so importing all_blueprints no longer drags 400+ MB of native
extensions into every forked worker.

Three cases needed more than moving the statement:
- apriltag: _FAMILIES held cv2.aruco constants at module level, now a
  functools.cache'd _families()
- rerun bridge: pydantic evaluates Config's annotations at runtime, so
  BlueprintFactory/VisualOverride resolve to bare Callable off the type
  checker and the explicit model_rebuild() is gone
- relocalize: the _reg = o3d.pipelines.registration alias moved into its
  four callers

Tests that monkeypatched a module-level rr/o3d now patch rerun.log and
sys.modules["open3d"] instead.
@leshy leshy changed the title Ivan/feat/go2obs unitree-go2 efficiency review Jul 29, 2026
leshy added 2 commits July 29, 2026 19:09
# Conflicts:
#	dimos/cli/apriltag3d.py
#	dimos/mapping/cli/replay.py
#	dimos/mapping/cli/replay_marker.py
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
dimos/mapping/voxels/impl/o3d.py 18.75% 52 Missing ⚠️
dimos/protocol/service/zenohservice.py 59.67% 23 Missing and 2 partials ⚠️
...imos/protocol/service/system_configurator/zenoh.py 77.77% 16 Missing ⚠️
dimos/mapping/voxels/grid.py 83.60% 6 Missing and 4 partials ⚠️
dimos/codebase_checks/test_inline_heavy_imports.py 82.60% 4 Missing and 4 partials ⚠️
dimos/mapping/relocalization/relocalize.py 12.50% 7 Missing ⚠️
dimos/visualization/rerun/bridge.py 45.45% 6 Missing ⚠️
dimos/mapping/voxels/impl/packed.py 88.88% 3 Missing and 2 partials ⚠️
dimos/msgs/sensor_msgs/Image.py 61.53% 5 Missing ⚠️
dimos/mapping/cli/replay.py 0.00% 4 Missing ⚠️
... and 31 more
@@            Coverage Diff             @@
##             main    #3272      +/-   ##
==========================================
- Coverage   75.69%   74.85%   -0.84%     
==========================================
  Files        1131     1137       +6     
  Lines      108747   108994     +247     
  Branches     9807     9834      +27     
==========================================
- Hits        82313    81591     -722     
- Misses      23630    24611     +981     
+ Partials     2804     2792      -12     
Flag Coverage Δ
OS-ubuntu-24.04-arm 68.66% <69.03%> (-0.27%) ⬇️
OS-ubuntu-latest 70.78% <69.03%> (-0.26%) ⬇️
Py-3.10 70.77% <69.03%> (-0.26%) ⬇️
Py-3.11 70.77% <69.03%> (-0.26%) ⬇️
Py-3.12 70.77% <69.03%> (-0.26%) ⬇️
Py-3.13 70.77% <69.03%> (-0.26%) ⬇️
Py-3.14 70.78% <69.03%> (-0.26%) ⬇️
Py-3.14t 70.77% <69.03%> (-0.26%) ⬇️
SelfHosted-Large 29.02% <30.64%> (+0.03%) ⬆️
SelfHosted-Linux 35.89% <46.57%> (+0.01%) ⬆️
SelfHosted-macOS ?

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

Files with missing lines Coverage Δ
dimos/cli/apriltag3d.py 91.32% <100.00%> (ø)
dimos/cli/cameracalibrate/cameracalibrate.py 78.16% <100.00%> (+0.58%) ⬆️
dimos/cli/dimos.py 67.54% <100.00%> (+0.30%) ⬆️
dimos/core/coordination/module_coordinator.py 85.04% <100.00%> (+0.04%) ⬆️
dimos/core/coordination/python_worker.py 72.87% <ø> (-0.22%) ⬇️
dimos/core/global_config.py 83.69% <100.00%> (+0.36%) ⬆️
dimos/core/o3dpickle.py 85.71% <100.00%> (+1.09%) ⬆️
...os/experimental/scene_cooking/browser/collision.py 77.77% <100.00%> (ø)
...dware/sensors/lidar/fastlio2/fastlio_blueprints.py 100.00% <100.00%> (ø)
...ware/sensors/lidar/pointlio/pointlio_blueprints.py 100.00% <100.00%> (ø)
... and 64 more

... and 38 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.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (105 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@mintlify

mintlify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
dimensional 🟢 Ready View Preview Jul 29, 2026, 5:35 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Comment thread dimos/robot/unitree/go2/connection.py Outdated
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 29, 2026
Comment thread dimos/msgs/sensor_msgs/Image.py Outdated
Co-authored-by: Paul Nechifor <paul@nechifor.net>
@leshy
leshy enabled auto-merge July 30, 2026 07:20
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 30, 2026
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 30, 2026
# Conflicts:
#	dimos/perception/test_object_scene_registration_temporal.py
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 30, 2026
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 30, 2026
spomichter
spomichter previously approved these changes Jul 30, 2026
@leshy
leshy added this pull request to the merge queue Jul 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 30, 2026
The wavefront exploration feature is being replaced; its tests were too
flaky to keep gating CI.
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 30, 2026
@paul-nechifor
paul-nechifor enabled auto-merge July 30, 2026 10:22
@paul-nechifor
paul-nechifor added this pull request to the merge queue Jul 30, 2026
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 30, 2026
@leshy
leshy added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit f858707 Jul 30, 2026
30 of 33 checks passed
@leshy
leshy deleted the ivan/feat/go2obs branch July 30, 2026 17:56
leshy added a commit that referenced this pull request Jul 30, 2026
Conflicts, all from main's inline-heavy-imports sweep (#3272) landing on files
this branch moved or deleted:

- dimos/perception/common/utils.py: kept the branch's deletion (dead code,
  nothing imports it) over main's cv2 inlining.
- test_object_scene_registration_temporal.py: took main's sys.modules patch,
  since open3d is now imported inside get_full_scene_pointcloud().
- tool_localize.py: new on this branch, so it never got the sweep - moved the
  rerun render into a function so the imports are inline.
leshy added a commit that referenced this pull request Jul 30, 2026
main's inline-heavy-imports sweep (#3272) dropped the module-level cv2 that
this method, added on this branch, was still using.
TomCC7 pushed a commit that referenced this pull request Jul 30, 2026
main's inline-heavy-imports sweep (#3272) dropped the module-level cv2 that
this method, added on this branch, was still using.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Required CI checks have passed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants