S4.3 — Space resolution: valid segment count
Intent
Resolution belongs to the state space, not to the planners. Today compound, SE2 and SE3 merge their components' longest valid segment lengths by weighted RMS, which under-samples rotation: SE2 on [0,10]² at default settings would inspect a 180° turn every 36° once the ×0.1 factor goes (rotation alone needs 9°). Adopt OMPL's rule (max of per-component segment counts) and OMPL's default fraction. Supersedes part of S2.2 (cancelled).
Decisions (ADR-0003; grilling Q2/Q3/Q13)
- New provided method
StateSpace::valid_segment_count(&self, s1, s2) -> usize, defaultceil(distance(s1, s2) / longest_valid_segment_length()). Custom spaces keep working unchanged. CompoundStateSpace,SE2StateSpace,SE3StateSpaceoverride it with the max over components of each component's own count (OMPLCompoundStateSpace::validSegmentCount).- Default longest-valid-segment fraction 0.01 (was 0.05) in RealVector, SO2, SO3. Single spaces become 2× coarser than today's effective spacing; compound spaces become finer than today.
- Migration note for users: set the fraction to 0.005 to reproduce the old single-space spacing.
- OMPL's extra
longestValidSegmentCountFactoris not adopted (the fraction covers it; can be added later as a provided method). - The ×0.1 factor itself is removed in S4.4, not here: S4.3 only adds the method and changes defaults, so behaviour shifts in two observable steps.
Acceptance criteria
Tasks
Open question (resolve at implementation, flag to owner)
- The fraction setters clamp to
[0, 1](real_vector_state_space.rs:121,so2:82,so3:87), so a fraction of 0 gives a zero length and a division by zero invalid_segment_count. OMPL throws for fractions outside (ε, 1−ε). Options: reject non-positive fractions (breaking: setter becomes fallible) or guard the division (count =usize::MAX/error). Breaking is acceptable in 0.9.0; pick one and record it in the PR.
Source
Agreed in the senior-engineer grilling 2026-10-08 (decisions: repo docs/planning/adr/0003-motion-validation.md; glossary: CONTEXT.md). Regeneration spec: oxmpl - sprint-003. Line references are as of origin/main c558556 (2026-10-08), before E3. E3 renames things (rand Rng→RngExt, PyO3 with_gil→attach, edition 2024), so re-grep before trusting a line number.