Skip to content

refactor: generated CDR replanning Module and controllers - #4678

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-navigation-safetyfrom
cc/feat/cdr-replanning-planner
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-navigation-safetyfrom
cc/feat/cdr-replanning-planner

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026

Copy link
Copy Markdown
Member

ReplanningAStarPlanner now uses generated CDR values throughout its Module ports, Global/LocalPlanner, P/PD controllers and navigation specs. Odometry and clicked points become owned nested PoseStamped values with exact source Headers. Footprint clearing edits an owned occupancy array; empty paths retain the available source Header. Port names, RPC names, control gains, thresholds, planner state machine and scheduling remain intact.

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

Category Files Change
Planner/controller/data boundaries 7 Generated nested values, canonical commands, source metadata and numeric access
Navigation interfaces/specs 3 Generated goal type; existing method and port names
Occupancy helper 1 Existing outside-map unknown semantics on generated values
Tests 2 Controller/state math, exact conversions, existing wall-inflation regression and real CDR Module chain
CI 1 Installed-wheel provenance and focused checks

After installing this commit, this directly computes a command without actuating hardware:

import numpy as np
from dimos.core.global_config import GlobalConfig
from dimos.messages.geometry_msgs.msg import Point, Pose, PoseStamped, Quaternion
from dimos.messages.std_msgs.msg import Header
from dimos.msgs.time import time_from_nanoseconds
from dimos.navigation.go2.replanning_a_star.controllers import PController

pose = PoseStamped(
    header=Header(frame_id="world", stamp=time_from_nanoseconds(1700000000123456789)),
    pose=Pose(position=Point(x=0, y=0, z=0), orientation=Quaternion(x=0, y=0, z=0, w=1)),
)
command = PController(GlobalConfig(), speed=0.55, control_frequency=10).advance(np.array([1., 0.]), pose)
assert command.linear.x == 0.55 and command.angular.z == 0

For the actual SDK Module pub/sub path, from the dev checkout run:

python -m pytest --noconftest --import-mode=importlib -o addopts='' -q \
  dimos/navigation/go2/replanning_a_star/test_generated_planner.py \
  -k actual_planner_module

That acceptance uses actual CdrTransport/MemoryRPC memq ports and the compiled A*: costmap + odometry + goal → generated Path → rotation feedback → forward Twist → stop Bool → zero Twist. No fake Module/ports and no robot. It owns subscription, transport and thread cleanup.

Validation: 135 source and 135 installed-wheel checks, including 19 planner/controller/conversion checks and dependent A*/safety/rendering/resampling/operations regressions. Eleven production files pass strict typing; applicable hooks and normal main wheel build pass; the full default runtime environment passes pip check (198 packages). The exact Python snippet above passes against the installed wheel. Hardware, benchmark and GitHub CI results are not claimed. Default encoding factories and other navigation/robot consumers remain subsequent layers; explicit CDR bindings are still required in this layer.

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