Skip to content

refactor: migrate pointcloud costmaps and CostMapper ports to CDR - #4671

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-occupancy-operationsfrom
cc/feat/cdr-pointcloud-costmaps
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-occupancy-operationsfrom
cc/feat/cdr-pointcloud-costmaps

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026

Copy link
Copy Markdown
Member

CostMapper now consumes generated PointCloud2 and publishes generated OccupancyGrid. The existing pointcloud-to-grid functions also accept generated clouds while retaining legacy input/output behavior for unmigrated callers; the numeric kernels are shared. Generated output copies the original Header, including empty-cloud and zero/negative/epoch timestamps, instead of reconstructing source time from float seconds. The initial safe disc copies the read-only cell view before updating generated data.

Parent: #4670. Part of the message encoding refactor.

Files Change
Pointcloud occupancy algorithms Explicit generated/legacy overloads and value construction around the unchanged numeric kernels; legal missing generated points filtered before rasterization
CostMapper Generated port types, output-type validation and cell updates preserving metadata
One adjacent test file Real memory-LCM RPC/ports/CDR, merged-map selection, independent Header copies, source-time edge cases, and actual apartment/big-office golden regression
Workflow Installed-module provenance, focused cases, two strict production files and the existing Numba dependency

Run this with the proposal's installed main package:

import numpy as np
from dimos.messages.builtin_interfaces.msg import Time
from dimos.messages.std_msgs.msg import Header
from dimos.msgs.pointcloud import pointcloud_from_xyz
from dimos.mapping.pointclouds.occupancy import simple_occupancy

cloud = pointcloud_from_xyz(
    np.array([[0, 0, 0.4], [1, 1, 0]], dtype=np.float32),
    header=Header(frame_id="map", stamp=Time(sec=0, nanosec=1)),
)
grid = simple_occupancy(cloud, resolution=0.25)
assert grid.header.stamp.nanosec == 1
assert 100 in grid.data

From a prepared checkout, run NUMBA_NUM_THREADS=2 OMP_NUM_THREADS=2 python -m pytest --noconftest -o addopts='' -o 'markers=self_hosted: optional project fixture case' -m 'not self_hosted' -q dimos/mapping/test_generated_costmapper.py for 21 checks without external assets or network. Including its three self_hosted-marked project-data cases runs the existing apartment/big-office goldens through real CDR input/output. They use the PLY's original float64 point fields so fixture coordinates are not quantized before comparison.

Validation: 24 source checks pass, including all three real-data goldens; 21 installed-main-wheel checks pass with actual production modules asserted to come from site-packages (three source-data cases deselected). Real RPC and CDR Module ports use memq://, with owned teardown and event waits. Five existing project LFS archives were size/SHA256 verified before safe extraction; pointcloud archives total about 20.5 MB compressed,155.5 MB expanded. Two production files pass strict typing; applicable hooks, normal main wheel and default 198-package pip check pass. Wheel SHA256 db99fa66ad30a73bd12c9567611a3001ad60b396faa607f4f7e6831471c6ac74.

Numba reports that this environment's TBB interface is too old and disables that threading layer; numeric checks pass on the available fallback. No performance claim or benchmark investigation. The original legacy live-Moment module was not collected because it constructs a default-network transport at import. No hardware operation, host/network configuration changes or CI polling. The default encoding factory and remaining mapping producers are still separate cutover work.

@TomCC7 TomCC7 closed this Oct 20, 2026
@TomCC7
TomCC7 deleted the cc/feat/cdr-pointcloud-costmaps branch October 20, 2026 18:11
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