Skip to content

fix(mapping): install GTSAM wheels for Go2 replay - #5455

Open
aa-MONTS wants to merge 4 commits into
mainfrom
aa-monts/fix/mapping-gtsam-wheels
Open

aa-MONTS wants to merge 4 commits into
mainfrom
aa-monts/fix/mapping-gtsam-wheels

Conversation

@aa-MONTS

@aa-MONTS aa-MONTS commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Install a usable GTSAM mapping library on Linux x86-64 with Python 3.10 so Go2 replay doesn’t fail after following the install instructions.

To be reviewed by @jeff-hykin.

Why do we need this?

On Linux x86-64 with Python 3.10, installing the Unitree extra leaves out the GTSAM bindings. Go2 replay reads its recording and then the pose-graph mapper exits at import gtsam.

What is this feature?

Use upstream GTSAM for the mapping extra. The lock selects 4.3a1 on Python 3.10 and 4.3.0 on Python 3.11 and 3.12. A fork-only dependency cannot supply the Linux 3.10 wheel, and switching between distributions by platform would leave the same public import backed by different implementations. The mapper passes its existing translation array to Pose3. The test and lint environments keep the repository’s pytest 8.3.5 pin; switching GTSAM does not upgrade pytest.

When upgrading an existing environment, uninstall gtsam-extended first. The distributions share files under gtsam/; reinstalling the upstream package restores those files if the fork was removed last. The requirements guide includes the commands.

How to manually run this

In a clean checkout on Linux x86-64 with CPython 3.10 available, make a fresh environment and install the headless replay dependencies.

uv venv --python 3.10 .venv
. .venv/bin/activate
DIMOS_ALLOW_MISSING_COCKPIT=1 uv pip install --torch-backend cpu '.[base,unitree,sim,drone]'
python -c 'from importlib.metadata import version; from gtsam import Pose3; print(version("gtsam"), Pose3().translation())'
python -c 'from dimos.utils.data import get_data; print(get_data("go2_short.db"))'
dimos --viewer none --replay run unitree-go2

Once the blueprint starts, run dimos topic echo odom in a second shell with the same environment active. The recording should produce changing positions. Stop both commands with Ctrl-C.

The provider change produced 117 changing poses on Linux x86-64 with Python 3.10. The rebased proposal was checked against the Linux target’s locked dependencies and with native macOS ARM64 replay. The rebased fix was then installed into a fresh virtual environment on Ubuntu 26.04 x86-64 with Python 3.10 (the commit after it only moves a test file): main failed at import gtsam and its Go2 replay exited before start-up completed, while this branch imported GTSAM 4.3a1 and the replay published 176 odometry samples at 169 distinct positions in ten seconds. Hardware operation and fork-specific APIs outside dimOS mapping were not verified.

Which issue(s) does this PR close?

Fixes DIM-716

Checklist

  • I have read and approved the CLA.

@aa-MONTS aa-MONTS added the backport:skip Skip creating a backport to any release branches label Nov 21, 2026

@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: 1b02f17 Previous: 004b793 Ratio
peak memory 1791.746 MB 1788.332 MB 1.00
peak threads 374 threads 373 threads 1.00
network (transport) 2722.417 MB 2731.926 MB 1.00
disk write 1.941 MB 1.891 MB 1.03
instructions 141.673 G 142.569 G 0.99

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

@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
9393 1 9392 49
View the full list of 1 ❄️ flaky test(s)
dimos.robot.unitree.g1.test_wholebody_connection::test_canonical_source_routes_model_order_and_keeps_limits

Flake rate in main: 50.00% (Passed 1 times, Failed 1 times)

Stack Traces | 0.532s run time
connection = <dimos.robot.unitree.g1.wholebody_connection.G1WholeBodyConnection object at 0x70c1ab876590>

    def test_canonical_source_routes_model_order_and_keeps_limits(connection):
        publisher = _wire(connection, soft_start_seconds=0.0)
        connection._connected = True
        connection._low_state = SimpleNamespace()
        connection._state_received_at = time.monotonic()
        source = ConnectionSource(connection.config, ["position_command"], ["joint_state"], 0.2)
        # A real model-valid pose, including asymmetric knee/ankle limits.
        pose = {
            name: max(limit.lo or 0.0, min(0.0, limit.hi or 0.0))
            for name in G1_JOINT_NAMES
            for limit in [source.position_limit(name)]
        }
        source.on_message(
            "joint_state",
            JointState(
                name=list(reversed(G1_JOINT_NAMES)),
                position=[pose[name] for name in reversed(G1_JOINT_NAMES)],
            ),
        )
        assert source.ready_for_control()
        values = source.command({name: (q, ControlMode.POSITION) for name, q in pose.items()})
        connection.command(values)
>       assert [frame[0] for frame in publisher.frames[-1]] == [pose[n] for n in G1_JOINT_NAMES]
E       assert [2146000000.0...000000.0, ...] == [0.0, 0.0, 0....0.0, 0.0, ...]
E         
E         At index 0 diff: #x1B[0m#x1B[94m2146000000.0#x1B[39;49;00m#x1B[90m#x1B[39;49;00m != #x1B[0m#x1B[94m0.0#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         
E         Full diff:
E         #x1B[0m#x1B[90m #x1B[39;49;00m [#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[91m-     0.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[92m+     2146000000.0,#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
E         #x1B[90m #x1B[39;49;00m ]#x1B[90m#x1B[39;49;00m

connection = <dimos.robot.unitree.g1.wholebody_connection.G1WholeBodyConnection object at 0x70c1ab876590>
pose       = {'g1/left_ankle_pitch': 0.0, 'g1/left_ankle_roll': 0.0, 'g1/left_elbow': 0.0, 'g1/left_hip_pitch': 0.0, ...}
publisher  = <dimos.robot.unitree.g1.test_wholebody_connection._FakePublisher object at 0x70c1ab876b00>
source     = <dimos.control.connection_source.ConnectionSource object at 0x70c35c086d70>
values     = {'g1/left_ankle_pitch/position': 0.0, 'g1/left_ankle_roll/position': 0.0, 'g1/left_elbow/position': 0.0, 'g1/left_hip_pitch/position': 0.0, ...}

.../unitree/g1/test_wholebody_connection.py:158: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Switches the mapping extra to upstream gtsam so Go2 replay can install its bindings on Linux with Python 3.10.

  • Go2 replay can load its pose-graph mapper with upstream GTSAM.
  • Lint and test environments can use newer pytest versions.

Reviews (2) · Last reviewed commit: "test(mapping): collect the GTSAM provide..." · Reviewed by Greptile

Comment thread dimos/mapping/test_mapping_extra.py Resolved
gtsam 4.3.0 declares pytest>=9.0.1 as a runtime dependency, as the fork
did, so the pin still needs its override. Without it the lock moved to
pytest 9.2.0, whose monkeypatch undo deletes Starlette state attributes
and fails the parametrized teleop skill test from its second case on.
The install built a wheel, which needs built web assets and replaces an
editable install. A failed install was also hidden by the import check
that followed it, so the docs job reported the block as passing.

This branch has not been deployed

No deployments
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant