step.base ========= .. py:module:: step.base Attributes ---------- .. autoapisummary:: step.base.StepAnomalyCallback Classes ------- .. autoapisummary:: step.base.Step Module Contents --------------- .. py:data:: StepAnomalyCallback .. py:class:: Step Bases: :py:obj:`raccoon.class_name_logger.ClassNameLogger` Base async action executed by missions and higher-level step combinators. .. py:method:: required_resources() -> frozenset[str] Return the hardware resources this step requires exclusive access to. For leaf steps (drive, motor, servo), return the resources this step directly uses. Composite steps override ``collected_resources`` instead to include children — ``required_resources`` stays empty for composites because they don't touch hardware themselves. .. py:method:: collected_resources() -> frozenset[str] Return all resources this step *and its children* require. Used by ``validate_no_overlap`` for static conflict detection at construction time. Leaf steps don't need to override this — the default delegates to ``required_resources``. Composite steps override to union their children's collected resources. .. py:method:: resolve() -> Step Return the concrete Step that should actually execute. Default returns ``self``. ``StepBuilder`` overrides this to call ``_build()`` so that fluent-DSL builders are converted into the underlying Step at composite-construction time. Composite steps call ``resolve()`` on their children before storing them so that ``validate_no_overlap`` and ``collected_resources`` see the real resource sets, not empty builder placeholders. .. py:method:: run_step(robot: raccoon.robot.api.GenericRobot) -> None :async: Execute the step with logging and optional timing instrumentation. When a per-step ``_anomaly_callback`` is set and a timing baseline exists, a background watchdog fires the callback as soon as the elapsed time exceeds the anomaly upper bound — even while the step is still running. .. py:method:: to_simulation_step() -> step.model.SimulationStep Convert this step to a simulation-friendly summary. The default implementation uses timing history only when it can query the tracker synchronously; otherwise it returns conservative defaults. Override in subclasses that know their motion delta or exact duration.