Skip to content

never-merge: SimpleLidar — onboard L1 lidar re-expressed as the Mid-360#2721

Draft
jeff-hykin wants to merge 7 commits into
jeff/hack/kronk-nav-4from
jeff/feat/kronk-nav-4-l1
Draft

never-merge: SimpleLidar — onboard L1 lidar re-expressed as the Mid-360#2721
jeff-hykin wants to merge 7 commits into
jeff/hack/kronk-nav-4from
jeff/feat/kronk-nav-4-l1

Conversation

@jeff-hykin

Copy link
Copy Markdown
Member

Summary

Adds SimpleLidar, a drop-in GO2Connection subclass that re-expresses the Go2's onboard L1 lidar in the Mid-360 frame (world→base_link un-transform, un-accumulated, then the static base_link→mid360_link mount transform) so downstream stacks calibrated for the Mid-360 see the L1 cloud in the frame they expect. Wires it into the unitree-go2-l1-lidar and unitree-go2-mid360-record-combined blueprints, splits the rotated mount into its own nav-3d variant, and promotes base_to_frame_matrix plus a GO2Connection._publish_lidar override seam.

Test plan

  • uv run pytest dimos/robot/test_all_blueprints_generation.py
  • Replay a recording through the 3D planner (plan_rrd.py) and confirm the L1 cloud lands in mid360_link

Pulls the Go2 WebRTC lidar (stamped world/odom-accumulated onboard), undoes
the world transform back to base_link, and optionally applies a rigid
transform (16-float 4x4) restamped to an output_frame so the cloud can pose as
another sensor. un_accumulate subtracts the prior cloud in the world frame and
publishes only new points, turning the accumulating stream into per-scan deltas.
Sibling to nav_3d that runs SimpleLidar with transform =
inv(base_link->mid360_link) from the URDF, stamping the cloud mid360_link so the
Go2 onboard lidar appears to originate from the Mid-360 frame. Promotes
base_to_frame_matrix to public in mount_correction for reuse.
…eprint

Replace the USE_ROTATED_MID360_MOUNT constant with two blueprints from a shared
_nav_3d() factory: unitree-go2-nav-3d (normal mount) and
unitree-go2-nav-3d-rotated (applies the mount_correction transform). Regenerate
all_blueprints.py.
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2009 1 2008 159
View the top 1 failed test(s) by shortest run time
dimos.robot.test_all_blueprints_generation::test_all_blueprints_is_current
Stack Traces | 2.85s run time
def test_all_blueprints_is_current() -> None:
        root = DIMOS_PROJECT_ROOT / "dimos"
        all_blueprints, all_modules = _scan_for_blueprints(root)
    
        common = set(all_blueprints.keys()) & set(all_modules.keys())
        assert not common, (
            f"Names must be unique across blueprints and modules, "
            f"but these appear in both: {sorted(common)}"
        )
    
        generated_content = _generate_all_blueprints_content(all_blueprints, all_modules)
    
        file_path = root / "robot" / "all_blueprints.py"
    
        if "CI" in os.environ:
            if not file_path.exists():
                pytest.fail(f"all_blueprints.py does not exist at {file_path}")
    
            current_content = file_path.read_text()
            if current_content != generated_content:
                diff = difflib.unified_diff(
                    current_content.splitlines(keepends=True),
                    generated_content.splitlines(keepends=True),
                    fromfile="all_blueprints.py (current)",
                    tofile="all_blueprints.py (generated)",
                )
                diff_str = "".join(diff)
>               pytest.fail(
                    f"all_blueprints.py is out of date. Run "
                    f"`pytest dimos/robot/test_all_blueprints_generation.py` locally to update.\n\n"
                    f"Diff:\n{diff_str}"
                )
E               Failed: all_blueprints.py is out of date. Run `pytest dimos/robot/test_all_blueprints_generation.py` locally to update.
E               
E               Diff:
E               --- all_blueprints.py (current)
E               +++ all_blueprints.py (generated)
E               @@ -121,6 +121,7 @@
E                    "unitree-go2-markers": "dimos.robot.unitree.go2.blueprints.smart.unitree_go2:unitree_go2_markers",
E                    "unitree-go2-memory": "dimos.robot.unitree.go2.blueprints.smart.unitree_go2:unitree_go2_memory",
E                    "unitree-go2-mid360-record": "dimos.robot.unitree.go2.blueprints.basic.unitree_go2_mid360_record:unitree_go2_mid360_record",
E               +    "unitree-go2-mid360-record-combined": "dimos.robot.unitree.go2.blueprints.basic.unitree_go2_mid360_record_combined:unitree_go2_mid360_record_combined",
E                    "unitree-go2-nav-3d": "dimos.robot.unitree.go2.blueprints.navigation.unitree_go2_nav_3d:unitree_go2_nav_3d",
E                    "unitree-go2-nav-3d-rotated": "dimos.robot.unitree.go2.blueprints.navigation.unitree_go2_nav_3d:unitree_go2_nav_3d_rotated",
E                    "unitree-go2-relocalization": "dimos.robot.unitree.go2.blueprints.smart.unitree_go2:unitree_go2_relocalization",

all_blueprints = {'alfred-nav': 'dimos.robot.diy.alfred.blueprints.alfred_nav:alfred_nav', 'coordinator-basic': 'dimos.control.blueprin...oordinator-cartesian-ik-piper': 'dimos.robot.manipulators.piper.blueprints.teleop:coordinator_cartesian_ik_piper', ...}
all_modules = {'alfred-high-level': 'dimos.robot.diy.alfred.effector_high_level.AlfredHighLevel', 'arm-teleop-module': 'dimos.teleop..._navigation.BBoxNavigationModule', 'b1-connection-module': 'dimos.robot.unitree.b1.connection.B1ConnectionModule', ...}
common     = set()
current_content = '# Copyright 2025-2026 Dimensional Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the "License");\n# you m...ebsocket_vis_module.WebsocketVisModule",\n    "zed-camera": "dimos.hardware.sensors.camera.zed.camera.ZEDCamera",\n}\n'
diff       = <generator object unified_diff at 0xff8479773920>
diff_str   = '--- all_blueprints.py (current)\n+++ all_blueprints.py (generated)\n@@ -121,6 +121,7 @@\n     "unitree-go2-markers": ...    "unitree-go2-relocalization": "dimos.robot.unitree.go2.blueprints.smart.unitree_go2:unitree_go2_relocalization",\n'
file_path  = PosixPath('.../dimos/robot/all_blueprints.py')
generated_content = '# Copyright 2025-2026 Dimensional Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the "License");\n# you m...ebsocket_vis_module.WebsocketVisModule",\n    "zed-camera": "dimos.hardware.sensors.camera.zed.camera.ZEDCamera",\n}\n'
root       = PosixPath('.../dimos/dimos/dimos')

dimos/robot/test_all_blueprints_generation.py:76: Failed

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

@jeff-hykin jeff-hykin changed the title feat(go2): SimpleLidar — onboard L1 lidar re-expressed as the Mid-360 never-merge: SimpleLidar — onboard L1 lidar re-expressed as the Mid-360 Jul 5, 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.

1 participant