step.motion.path.compiler¶
PathCompiler — turns a list of Steps into a CompiledPlan.
The compiler is a thin orchestrator: it lowers the input Step tree into the
IR via the lowering pass, then runs each subsequent CompilerPass in sequence
on the resulting node list. The result is a CompiledPlan that the
PathExecutor knows how to run.
Classes¶
Pure transform on the path IR. |
|
Result of compiling a Step tree. |
|
Orchestrates the compiler pipeline. |
Module Contents¶
- class step.motion.path.compiler.CompilerPass¶
Bases:
ProtocolPure transform on the path IR.
A pass takes a node list and returns a (possibly different) node list. Passes must preserve the “deferred placeholder” (
None) entries so the executor can resolve them at runtime.
- class step.motion.path.compiler.CompiledPlan¶
Result of compiling a Step tree.
nodes— the path IR after all passes ran. Spline mode lowersto a single
Segment(kind="spline")node here, so the executor walks it through the unified loop like any other opaque segment.
deferred—(index, Defer)pairs for runtime resolution.passes_applied— names of passes that ran, for diagnostics.- deferred: list[tuple[int, step.logic.defer.Defer]]¶
- class step.motion.path.compiler.PathCompiler(passes: list[CompilerPass] | None = None)¶
Orchestrates the compiler pipeline.
Lowering is always run first (it produces the IR from the Step tree). The remaining passes are applied in the order given.
Example
>>> from raccoon.step.motion.path.passes import MergePass, CornerCutPass >>> compiler = PathCompiler([MergePass(), CornerCutPass(0.05)]) >>> plan = compiler.compile([drive(50), turn(90), drive(30)])
- compile(steps: list) CompiledPlan¶
Lower
stepsto IR and run all configured passes.