Skip to content

refactor: generated CDR occupancy rendering and path masks - #4676

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-path-resamplingfrom
cc/feat/cdr-map-rendering
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-path-resamplingfrom
cc/feat/cdr-map-rendering

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026

Copy link
Copy Markdown
Member

Occupancy/path renderers and safety masks accept generated values. Generated images use the canonical bgr8 Image schema with an owned exact source Header. Existing palette, footprint, opacity, clipping and occupied-fraction logic stays shared; legacy callers retain their original image value type.

The focused tests also exposed NumPy 2 rejecting 255 inside an int8 np.where in the existing Turbo lookup. Building uint8 indices before assigning unknown=255 preserves the original colors without overflow.

Parent: #4675. Project: https://linear.app/dimensional/project/message-encoding-refactor-05a3ddb4af3e/overview

Category Files Change
Numeric adapters 1 Explicit generated grid coordinates and array access typing
Mask/rendering 3 Generated nested paths, canonical images and retained shared algorithms
Tests 1 Exact pixels, palettes, safety thresholds, rotated coordinates, ownership and CDR
CI 1 Installed-wheel provenance and scoped checks

After installing this commit, run the offline example:

import numpy as np
from dimos.mapping.occupancy.visualizations import visualize_occupancy_grid
from dimos.messages.std_msgs.msg import Header
from dimos.msgs.image import image_view
from dimos.msgs.occupancy import occupancy_from_array
from dimos.msgs.time import time_from_nanoseconds

costmap = occupancy_from_array(
    np.array([[-1, 0, 100]], dtype=np.int8), resolution=1.0,
    header=Header(frame_id="map", stamp=time_from_nanoseconds(1700000000123456789)),
)
image = visualize_occupancy_grid(costmap, "turbo")
assert image.encoding == "bgr8" and image.header == costmap.header
np.testing.assert_array_equal(image_view(image), [[[28, 24, 34], [27, 23, 35], [0, 0, 0]]])

Validation: 79 source and 79 installed-wheel checks (34 rendering/mask, 21 occupancy operations and 24 resampling), six unchanged PNG golden regressions, strict typing of four production files, applicable hooks, normal main wheel build, full runtime pip check (198 packages). Seven project fixture archives were hash/size verified before safe extraction. Exact example above runs against the installed main wheel. No human visual acceptance, hardware, performance or GitHub CI result is claimed. Full navigation/controller ports, default cutover and legacy removal remain subsequent layers.

@TomCC7 TomCC7 closed this Oct 20, 2026
@TomCC7
TomCC7 deleted the cc/feat/cdr-map-rendering 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