Skip to content

refactor: generated CDR Python trajectory followers - #4680

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-movement-muxfrom
cc/feat/cdr-trajectory-followers
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-movement-muxfrom
cc/feat/cdr-trajectory-followers

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026

Copy link
Copy Markdown
Member

Basic/Fancy Python trajectory followers use generated Path/PoseStamped/TFMessage/Twist/Bool values. The existing laws, gains, lookahead, deadman, arrival latch, stop handling and scheduling stay intact. Profile decoding subtracts integer nanoseconds before converting deltas to seconds; the optional Rust law adapter receives relative seconds, avoiding epoch float loss.

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

Category Files Change
Python follower/control boundary 5 Generated nested fields; same module and law APIs
Profile/spec 2 Exact stamp deltas and generated port declarations
Tests 6 Port original assertions, real TF/MemoryRPC cleanup, actual CDR drive/arrival/preemption and Rust numerical parity
CI 1 Build optional Rust math extension and verify installed production code

After installing this commit, this directly computes a command without hardware or the optional Rust extension:

from dimos.messages.geometry_msgs.msg import Point, Pose, PoseStamped, Quaternion
from dimos.messages.nav_msgs.msg import Path
from dimos.messages.std_msgs.msg import Header
from dimos.msgs.time import time_from_nanoseconds
from dimos.navigation.trajectory_follower.fancy.laws.seed import PursuitController

header = Header(frame_id="odom", stamp=time_from_nanoseconds(1700000000123456789))
poses = [PoseStamped(
    header=header,
    pose=Pose(position=Point(x=x, y=0, z=0), orientation=Quaternion(x=0, y=0, z=0, w=1)),
) for x in [0., 2.]]
command = PursuitController().update(poses[0], Path(header=header, poses=poses), t=0.)
assert command.linear.x > 0 and command.angular.z == 0

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

python -m pytest --noconftest --import-mode=importlib -o addopts='' -q \
  dimos/navigation/trajectory_follower/test_generated_ports.py

Both actual modules use CdrTransport/MemoryRPC memq ports: TF + dense Path → forward Twist → updated TF at goal → arrival Bool → new goal drives → empty Path stops. All threads/subscriptions/transports are cleaned; no robot or fixed sleeps.

Validation: 49 source and 49 installed-wheel checks, including real compiled Rust law numerical parity with the original strict component/headroom assertions. Seven production files pass strict typing; applicable hooks, main wheel build and full default runtime pip check (198 packages) pass. The exact Python block above runs against the installed main wheel. Two old precision fixtures required sub-nanosecond timestamps; their distance/time inputs now use exactly representable ROS timing while retaining the original speed sweep/assertions/tolerances.

The optional Rust math wheel was built offline with Cargo --locked and 2 jobs; it is not a native transport module. Full native follower/local-planner Rust wire integration, other robot consumers, default cutover and legacy retirement remain later layers. Nix, hardware, performance and GitHub CI results are not claimed.

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