step.motion.at_distance_dsl

Auto-generated step builders and DSL functions — DO NOT EDIT.

Source: at_distance.py

Classes

WaitUntilDistanceBuilder

Builder for WaitUntilDistance. Auto-generated — do not edit.

Functions

wait_until_distance([cm])

Wait until the robot has driven at least the given distance.

Module Contents

class step.motion.at_distance_dsl.WaitUntilDistanceBuilder

Bases: raccoon.step.step_builder.StepBuilder

Builder for WaitUntilDistance. Auto-generated — do not edit.

cm(value: float)
step.motion.at_distance_dsl.wait_until_distance(cm: float = _UNSET)

Wait until the robot has driven at least the given distance.

Polls odometry straight-line distance from the origin at 100 Hz. Designed to run inside a parallel() branch alongside a drive step, enabling actions to trigger at specific distances during a drive.

Parameters:

cm – Distance threshold in centimeters.

Returns:

A WaitUntilDistanceBuilder (chainable via .cm(), .on_anomaly(), .skip_timing()).

Example:

from raccoon.step import parallel, seq
from raccoon.step.motion import drive_forward, wait_until_distance
from raccoon.step.servo import servo

# Open a servo after driving 30 cm into a 50 cm drive
parallel([
    drive_forward(50),
    seq([wait_until_distance(30), servo(claw, 90)]),
])