Skip to content

refactor(control): retire shared transport adapters - #5017

Merged
mustafab0 merged 32 commits into
mainfrom
cc/refactor/r1pro-connection
Nov 21, 2026
Merged

mustafab0 merged 32 commits into
mainfrom
cc/refactor/r1pro-connection

Conversation

@TomCC7

@TomCC7 TomCC7 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Overview

Migrate concrete connections to the shared joint/interface contract and retire the two shared transport adapters. Stacked on #5016.

Problem

The old adapters duplicate routing, while rotating native body commands through odometry unnecessarily couples driving to pose age.

Changes

  • R1Pro and Go2 accept body forward/lateral/turn actions directly, without an odom-yaw gate.
  • Publish velocity-only actuator JointState separately from pose/twist Odometry.
  • Preserve R1Pro measured chassis-speed odometry and its source timestamps.
  • Estimate Go2 body rates from successive measured poses; do not invent first-sample rates.
  • Route navigation followers through independent Odometry feedback.
  • Preserve G1/GR00T migration and remove the retired adapter implementations and registrations.

Validation

  • 29 focused driver/consumer checks independently passed, including hardware-free assembly parsing.
  • Targeted production mypy and Ruff passed.
  • Go2 rates are pose-difference estimates, not native chassis-rate samples. Hardware timing/accuracy and new CI remain unverified.

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go2 replay realtime (arm64)

Details
Benchmark suite Current: bc77500 Previous: 1e8989d Ratio
peak memory 1765.422 MB 1755.098 MB 1.01
peak threads 376 threads 365 threads 1.03
network (transport) 2725.017 MB 2728.417 MB 1.00
disk write 1.645 MB 1.602 MB 1.03
instructions 141.543 G 137.431 G 1.03

This comment was automatically generated by workflow using github-action-benchmark.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[High impact] The PR changes command and feedback paths for three robot platforms.

Fix the MuJoCo halt path before merging so the simulated Go2 stops when coordinator commands disappear.

Findings

  1. P1 Simulated Go2 ignores the stop ▶
  2. P2 Stale-feedback stop claim overstates protection ▶

Summary

Replaces shared transport adapters with direct joint commands for R1Pro, G1, and Go2.

  • R1Pro coordinators send joint commands straight to the robot connection.
  • G1 commands and feedback now use named robot joints.
  • Go2 controllers map planar commands using measured robot yaw.
  • Shared transport adapters are no longer available for robot control.

Reviews (2) · Last reviewed commit: "test(r1pro): keep focused driver smoke c..." · Reviewed by Greptile

Comment thread dimos/robot/galaxea/r1pro/README.md Resolved
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
dimos/robot/galaxea/r1pro/connection.py 63.18% 58 Missing and 9 partials ⚠️
dimos/robot/galaxea/r1pro/test_connection.py 89.94% 18 Missing ⚠️
dimos/robot/unitree/g1/wholebody_connection.py 78.08% 16 Missing ⚠️
dimos/robot/unitree/go2/connection.py 83.54% 10 Missing and 3 partials ⚠️
...ntrol/tasks/g1_groot_wbc_task/g1_groot_wbc_task.py 75.00% 3 Missing and 2 partials ⚠️
dimos/utils/transform_utils.py 58.33% 3 Missing and 2 partials ⚠️
...alaxea/r1pro/blueprints/basic/r1pro_coordinator.py 76.92% 3 Missing ⚠️
dimos/robot/unitree/mujoco_connection.py 25.00% 2 Missing and 1 partial ⚠️
...pose_follower_task/holonomic_pose_follower_task.py 84.61% 1 Missing and 1 partial ⚠️
...rol/tasks/path_follower_task/path_follower_task.py 81.81% 0 Missing and 2 partials ⚠️
... and 5 more
@@            Coverage Diff             @@
##             main    #5017      +/-   ##
==========================================
- Coverage   84.92%   81.62%   -3.31%     
==========================================
  Files        1963     1978      +15     
  Lines      192846   206777   +13931     
  Branches    15711    18342    +2631     
==========================================
+ Hits       163783   168783    +5000     
- Misses      25202    34157    +8955     
+ Partials     3861     3837      -24     
Components Coverage Δ
Tests 91.87% <95.72%> (-4.92%) ⬇️
Flag Coverage Δ
OS-macos-latest 79.56% <92.95%> (+0.22%) ⬆️
OS-ubuntu-26.04-arm 79.16% <92.95%> (+0.22%) ⬆️
OS-ubuntu-latest 79.61% <93.16%> (+0.23%) ⬆️
Py-3.10 79.61% <92.95%> (+0.23%) ⬆️
Py-3.11 79.58% <92.95%> (+0.23%) ⬆️
Py-3.12 79.60% <93.16%> (+0.23%) ⬆️
SelfHosted-Linux 40.55% <31.68%> (+<0.01%) ⬆️
SelfHosted-macOS 40.29% <31.68%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
dimos/control/benchmarking/test_benchmark.py 100.00% <100.00%> (+1.53%) ⬆️
dimos/control/path_following_coordinator.py 100.00% <100.00%> (ø)
.../tasks/g1_groot_wbc_task/test_g1_groot_wbc_task.py 100.00% <100.00%> (ø)
...ol/tasks/holonomic_pose_follower_task/_registry.py 100.00% <ø> (ø)
...follower_task/test_holonomic_pose_follower_task.py 100.00% <100.00%> (+0.94%) ⬆️
...imos/control/tasks/path_follower_task/_registry.py 100.00% <ø> (ø)
...asks/path_follower_task/test_path_follower_task.py 98.96% <100.00%> (+4.28%) ⬆️
.../control/tasks/rpp_path_follower_task/_registry.py 100.00% <ø> (ø)
..._path_follower_task/test_rpp_path_follower_task.py 100.00% <100.00%> (+0.74%) ⬆️
dimos/control/test_path_following_coordinator.py 100.00% <100.00%> (ø)
... and 32 more

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

TomCC7 and others added 11 commits November 9, 2026 21:00
…coordinator

A robot behind a ConnectionModule with a cmd_vel port had its base told 0
on every axis every tick, so no task could drive it. Now its base axes
(<robot>/base/vx, vy, wz) are registered like an adapter base's virtual
joints: tasks claim and win them in arbitration, the tick loop routes them
to their own per-robot entry so a velocity task on the base never
mode-conflicts with a position task on the joints, and ConnectionSource
fills each axis with the winner's speed or 0 when idle or stopped.

The coordinator's twist_command mapping covers connection robots too, so
the same teleop/nav publishers drive an adapter base or a connection base
unchanged. Estop semantics are unchanged: commands stop, the connection
module's own deadman halts the robot.

Arm-only coordinators and legacy adapter stacks are untouched: a robot
without a cmd_vel port has no base axes, and adapters never take the new
route.
Follow-up verification for the connection base winners: a velocity task or
twist drives vx, vy and wz each non-zero through to the robot's cmd_vel
port; two velocity tasks on the same base arbitrate by priority and the
loser resumes when the winner stops; and a task whose stream goes quiet
zeroes every axis, as an adapter base's does.
The velocity-task timeout can be observed by a later tick than the
sleep(0.1) boundary on slow or loaded runners (seen on macOS CI), so
keep ticking until the zeroed command shows up.
… hold

Greptile review on #5016:

- P1: OperatorHoldTask discovered axes only in the joint-state snapshot,
  which never contains a connection robot's base axes (they are commanded
  speeds, not read positions), so a running velocity task kept driving the
  base through a hold, including after an e-stop clear. The coordinator
  now names every connection base axis to the hold (on start and on
  add_task), and the hold zeroes them like an adapter base's velocity
  joints.
- P2: the base-timeout test slept 0.1s against a 0.2s reading timeout, so
  a paused runner stopped the command entirely and the zeroed twist never
  arrived (seen on macOS CI). The test now advances the task clock
  (perf_counter, the source of state.t_now) past the task timeout by hand
  and re-reports the base's feedback right before each tick, so only the
  task command expires.
- P2: the routing test drove an arm named mock and a base named go2, never
  exercising one robot's <robot>/base split and merge. A new test gives
  one robot joint ports and cmd_vel and asserts both commands leave in the
  same tick; another covers the route-level mode-conflict guard, which was
  the patch's only uncovered code.

Regressions: the hold zeroes a running base and keeps it after an e-stop
clear (connection level), and unit tests cover set_base_axes with and
without an e-stop.
The task clock (perf_counter) was already patched, but the connection
source stamps feedback receipts and checks their freshness with the real
monotonic clock, so a scheduling pause longer than reading_timeout_s
between the last report and the tick could still stale the feedback and
drop the zeroing command.

Patch time.monotonic with its own frozen clock too, and keep a real
0.25s pause between the report and the tick to prove a slow runner
cannot stale the feedback: with the monotonic patch removed the strict
assertions fail again.
@TomCC7 TomCC7 changed the title refactor(r1pro): drive the R1 Pro through its connection module, no adapters refactor(control): retire shared transport adapters Nov 10, 2026
@TomCC7
TomCC7 marked this pull request as ready for review November 10, 2026 08:53
@TomCC7
TomCC7 requested a review from jeff-hykin as a code owner November 10, 2026 08:53
Comment thread dimos/robot/unitree/go2/connection.py Resolved
Base automatically changed from cc/feat/connection-base-winners to main November 12, 2026 03:47
The Go2 blueprints built a full ConnectionConfig at import to copy its
contract fields. Main now checks for a robot IP when that config is built,
so importing the blueprints failed without ROBOT_IP. go2_joint_connection()
gives the coordinator the source, model and joint commands directly.
Solidify MetaBlueprints before reading atoms, give Go2 blueprint parsing a
documentation-range robot IP, patch the WebRTC class where go2.connection
now imports it, feed odometry to the followers in the benchmark test, check
the R1 Pro body axes instead of the planar joints, and wait with wait_until
instead of sleeping.
@mustafab0 mustafab0 added the backport:skip Skip creating a backport to any release branches label Nov 21, 2026
stop_movement did nothing in MuJoCo, so a halt left the simulated robot
walking at its last speed. It now sends zero speed.
@mustafab0
mustafab0 enabled stacked auto-merge (squash) November 21, 2026 21:08
@mustafab0
mustafab0 merged commit 3d91dbb into main Nov 21, 2026
42 of 43 checks passed
@mustafab0
mustafab0 deleted the cc/refactor/r1pro-connection branch November 21, 2026 21:25
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip Skip creating a backport to any release branches ready-to-merge Required CI checks have passed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants