Skip to content

refactor(mapping): export and replay canonical CDR maps offline - #4692

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-pgofrom
cc/feat/cdr-mapping-cli
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-pgofrom
cc/feat/cdr-mapping-cli

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Offline map tools use generated CDR messages for reconstruction, replay, marker detection and map viewing. dimos map global --export writes .pc2.cdr; dimos map view decodes it explicitly. Rendering retains spheres/boxes/screen-space points, height colors, per-point RGB and bottom clipping. Recorded TF is applied before drift correction; output map metadata names the actual resulting frame and retains the exact input Header stamp. Outlier removal selects original records, retaining per-point capture fields. Packaged camera calibration loads without importing a robot connection.

Linear: https://linear.app/dimensional/project/message-encoding-refactor-05a3ddb4af3e/overview

Parent: #4691. Relocalization's legacy .pc2.lcm reader is a subsequent consumer layer and cannot yet read this new export. Existing historical typed recordings need explicit conversion; no silent legacy fallback is added.

Category Files Changes
Offline CLI 4 Canonical map reconstruction/export/view/replay and pose-fill/marker integration
Rerun adapter 1 Explicit render modes, height palette and aligned XYZ/RGB filtering
Tests 2 Real SQLite→PGO→CDR export→view; TF registration; actual AprilTag and external pose stream; original synthetic view case retained
CI 1 Run actual CLI cases against installed modules, plus five strict files

Validation: 116 focused source checks and 117 installed-wheel checks pass, including the original full dimos map view CLI case in the full installed runtime environment (with the optional PGO test dependency). Five production files pass scoped strict mypy; applicable hooks pass. One extra cloud-renderer source regression passes. Running the full CLI import in the intentionally minimal source-test venv failed because GitPython is absent there; the full installed environment and independent dimos processes pass. Wheel SHA256: bedc2b0c8f4c0c83d00e05810bb9527f333cdb4ad77a5657f76fdd5e8508c63a.

For manual review after installing this branch with its mapping dependencies, create a tiny canonical recording in an empty directory:

import numpy as np
from dimos.memory.store.sqlite import SqliteStore
from dimos.messages.sensor_msgs.msg import PointCloud2
from dimos.messages.std_msgs.msg import Header
from dimos.msgs.pointcloud import pointcloud_from_xyz
from dimos.msgs.time import time_from_nanoseconds

with SqliteStore(path="demo.db") as store:
    lidar = store.stream("lidar", PointCloud2)
    for i in range(3):
        header = Header(frame_id="world", stamp=time_from_nanoseconds(1700000000123456789 + i * 1000000000))
        points = np.array([[i + 1.025, .025, .025]], dtype=np.float32)
        lidar.append(pointcloud_from_xyz(points, header=header), ts=10 + i,
                     pose=(i + 1, 0, 0, 0, 0, 0, 1))
dimos map global demo.db --device CPU:0 --pgo --export --no-gui --out demo.rrd
dimos map view demo.pc2.cdr --out viewed.rrd
rerun demo.rrd

The first two commands were executed as independent installed dimos processes outside the checkout. They produced a 157-byte CDR cloud with three points in world_corrected, a real 44 KiB reconstruction RRD and a 12 KiB view RRD. The official Rerun CLI reads the reconstruction's raw/corrected point clouds and trajectory strips. The final interactive viewer command is for human inspection and is not claimed as human acceptance.

No CI polling, benchmark, hardware, host-network changes or publication of packages. The optional GTSAM pytest metadata mismatch recorded in #4691 remains unchanged. This is a consumer layer, not the default cutover or completion of the migration.

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