step.motion.line_follow_builder

Classes

FollowCorrection

Enum where members are also (and must be) strings

ConfigurableLineFollowBuilder

Base class for generated step builders.

Functions

line_follow(→ ConfigurableLineFollowBuilder)

Module Contents

class step.motion.line_follow_builder.FollowCorrection

Bases: enum.StrEnum

Enum where members are also (and must be) strings

ANGULAR = 'angular'
LATERAL = 'lateral'
FORWARD = 'forward'
class step.motion.line_follow_builder.ConfigurableLineFollowBuilder

Bases: raccoon.step.step_builder.StepBuilder

Base class for generated step builders.

Subclasses must implement _build() to construct the real Step from the collected parameters.

Since StepBuilder extends Step, it satisfies StepProtocol and can be used anywhere a Step is expected (seq, parallel, mission step lists).

dual(left_sensor: raccoon.sensor_ir.IRSensor, right_sensor: raccoon.sensor_ir.IRSensor) ConfigurableLineFollowBuilder
single(sensor: raccoon.sensor_ir.IRSensor, side: step.motion.line_follow.LineSide = LineSide.LEFT) ConfigurableLineFollowBuilder
move(forward: float = 0.0, strafe: float = 0.0) ConfigurableLineFollowBuilder
forward_speed(value: float) ConfigurableLineFollowBuilder
strafe_speed(value: float) ConfigurableLineFollowBuilder
correct_angular() ConfigurableLineFollowBuilder
correct_lateral(hold_heading: bool = True) ConfigurableLineFollowBuilder
correct_forward(hold_heading: bool = True) ConfigurableLineFollowBuilder
correction_sign(value: float) ConfigurableLineFollowBuilder
hold_heading(degrees: float | None) ConfigurableLineFollowBuilder

Hold an absolute heading while correcting laterally/forward.

degrees is measured from the mark_heading_reference() origin (CCW-positive, same convention as turn_to_heading_left and drive_forward(heading=…)). Pass None (the default) to hold whatever heading the robot has when the step starts. Only takes effect together with correct_lateral() / correct_forward() (the heading-hold correction modes); it is a no-op under angular correction. Requires mark_heading_reference() earlier in the mission.

distance_cm(value: float | None) ConfigurableLineFollowBuilder
pid(kp: float, ki: float = 0.0, kd: float = 0.1, integral_max: float = 1.0, integral_min: float | None = None) ConfigurableLineFollowBuilder

Set the correction PID gains and its integral anti-windup band.

integral_max/integral_min clamp the PID’s accumulated integral (in the normalised correction space the PID emits, roughly [-1, 1]). Leave integral_min as None to mirror -integral_max (the classic symmetric clamp); set both explicitly for an asymmetric band (e.g. integral_min=0.0 for a one-sided integrator). Only matters when ki is non-zero.

until(value: raccoon.step.condition.StopCondition | None) ConfigurableLineFollowBuilder
step.motion.line_follow_builder.line_follow() ConfigurableLineFollowBuilder