step.motion.drive_angle_dsl =========================== .. py:module:: step.motion.drive_angle_dsl .. autoapi-nested-parse:: Auto-generated step builders and DSL functions — DO NOT EDIT. Source: drive_angle.py Classes ------- .. autoapisummary:: step.motion.drive_angle_dsl.DriveAngleBuilder step.motion.drive_angle_dsl.DriveAngleLeftBuilder step.motion.drive_angle_dsl.DriveAngleRightBuilder Functions --------- .. autoapisummary:: step.motion.drive_angle_dsl.drive_angle step.motion.drive_angle_dsl.drive_angle_left step.motion.drive_angle_dsl.drive_angle_right Module Contents --------------- .. py:class:: DriveAngleBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for DriveAngle. Auto-generated — do not edit. .. py:method:: angle_deg(value: float) .. py:method:: cm(value: float) .. py:method:: speed(value: float) .. py:method:: until(value: raccoon.step.condition.StopCondition) .. py:function:: drive_angle(angle_deg: float = _UNSET, cm: float = None, speed: float = 1.0, until: raccoon.step.condition.StopCondition = None) Drive at an arbitrary angle with distance or condition-based termination. Decomposes the desired heading into forward and lateral velocity components, then runs a profiled PID controller in a rotated coordinate frame with heading maintenance and cross-track correction. Requires a mecanum or omni-wheel drivetrain. Angle convention (robot-centric): ``0`` = forward, ``90`` = right, ``-90`` = left, ``180`` = backward. :param angle_deg: Travel angle in degrees. :param cm: Distance to travel in centimeters. Omit to use condition-only mode. :param speed: Fraction of max speed, 0.0 to 1.0. :param until: Stop condition for early termination. :returns: A DriveAngleBuilder (chainable via ``.angle_deg()``, ``.cm()``, ``.speed()``, ``.until()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import drive_angle # Drive diagonally forward-right at 45 degrees drive_angle(45, cm=30) # Drive pure right (same as strafe_right) drive_angle(90, cm=20) .. py:class:: DriveAngleLeftBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for DriveAngleLeft. Auto-generated — do not edit. .. py:method:: angle_deg(value: float) .. py:method:: cm(value: float) .. py:method:: speed(value: float) .. py:method:: until(value: raccoon.step.condition.StopCondition) .. py:function:: drive_angle_left(angle_deg: float = _UNSET, cm: float = None, speed: float = 1.0, until: raccoon.step.condition.StopCondition = None) Drive at an angle to the left with distance or condition-based termination. Convenience wrapper around ``DriveAngle`` that negates the angle so that the ``angle_deg`` parameter is always positive (pointing left). The angle is measured as degrees to the left of forward: ``0`` = forward, ``45`` = forward-left diagonal, ``90`` = pure left. :param angle_deg: Degrees to the left of forward (0 = forward, 90 = pure left). :param cm: Distance to travel in centimeters. Omit to use condition-only mode. :param speed: Fraction of max speed, 0.0 to 1.0. :param until: Stop condition for early termination. :returns: A DriveAngleLeftBuilder (chainable via ``.angle_deg()``, ``.cm()``, ``.speed()``, ``.until()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import drive_angle_left # Drive diagonally forward-left at 45 degrees drive_angle_left(45, cm=30) # Drive pure left until sensor drive_angle_left(90, speed=0.6).until(on_black(s)) .. py:class:: DriveAngleRightBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for DriveAngleRight. Auto-generated — do not edit. .. py:method:: angle_deg(value: float) .. py:method:: cm(value: float) .. py:method:: speed(value: float) .. py:method:: until(value: raccoon.step.condition.StopCondition) .. py:function:: drive_angle_right(angle_deg: float = _UNSET, cm: float = None, speed: float = 1.0, until: raccoon.step.condition.StopCondition = None) Drive at an angle to the right with distance or condition-based termination. Convenience wrapper around ``DriveAngle`` that passes the angle directly (positive = right in the robot frame). The angle is measured as degrees to the right of forward: ``0`` = forward, ``45`` = forward-right diagonal, ``90`` = pure right. :param angle_deg: Degrees to the right of forward (0 = forward, 90 = pure right). :param cm: Distance to travel in centimeters. Omit to use condition-only mode. :param speed: Fraction of max speed, 0.0 to 1.0. :param until: Stop condition for early termination. :returns: A DriveAngleRightBuilder (chainable via ``.angle_deg()``, ``.cm()``, ``.speed()``, ``.until()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import drive_angle_right # Drive diagonally forward-right at 45 degrees drive_angle_right(45, cm=30) # Drive pure right until sensor drive_angle_right(90, speed=0.6).until(on_black(s))