step.motion.wall_align_dsl ========================== .. py:module:: step.motion.wall_align_dsl .. autoapi-nested-parse:: Auto-generated step builders and DSL functions — DO NOT EDIT. Source: wall_align.py Classes ------- .. autoapisummary:: step.motion.wall_align_dsl.WallAlignForwardBuilder step.motion.wall_align_dsl.WallAlignBackwardBuilder step.motion.wall_align_dsl.WallAlignStrafeLeftBuilder step.motion.wall_align_dsl.WallAlignStrafeRightBuilder Functions --------- .. autoapisummary:: step.motion.wall_align_dsl.wall_align_forward step.motion.wall_align_dsl.wall_align_backward step.motion.wall_align_dsl.wall_align_strafe_left step.motion.wall_align_dsl.wall_align_strafe_right Module Contents --------------- .. py:class:: WallAlignForwardBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for WallAlignForward. Auto-generated — do not edit. .. py:method:: speed(value: float) .. py:method:: accel_threshold(value: float) .. py:method:: settle_duration(value: float) .. py:method:: max_duration(value: float) .. py:method:: grace_period(value: float) .. py:function:: wall_align_forward(speed: float = 1.0, accel_threshold: float = 0.5, settle_duration: float = 0.2, max_duration: float = 5.0, grace_period: float = 0.3) Drive forward into a wall and align the front of the robot. Apply constant forward velocity without heading correction so the robot naturally rotates flush against the wall surface. The step monitors gravity-compensated linear acceleration from the IMU and stops once a collision spike is detected followed by a short settle period. The grace period prevents false triggers from the initial acceleration transient when the robot starts moving. After the step completes, ``step.bump_result`` contains the impact magnitude, estimated wall misalignment angle, and the heading correction applied during the settle push. :param speed: Drive speed in m/s (default 1.0). :param accel_threshold: Minimum XY linear-acceleration magnitude in m/s² to classify as a bump (default 0.5). Lower values are more sensitive but may false-trigger on rough surfaces. :param settle_duration: Seconds to keep pushing after the bump is detected, letting the chassis rotate flush (default 0.2). :param max_duration: Safety timeout in seconds — the step finishes even if no bump is detected (default 5.0). :param grace_period: Seconds to ignore acceleration after starting, so the robot's own acceleration doesn't trigger detection (default 0.3). :returns: A WallAlignForwardBuilder (chainable via ``.speed()``, ``.accel_threshold()``, ``.settle_duration()``, ``.max_duration()``, ``.grace_period()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import wall_align_forward, drive_forward # Drive near the wall, then bump-align against it seq([drive_forward(30), wall_align_forward()]) # More sensitive detection at slower speed wall_align_forward(speed=0.3, accel_threshold=0.3) .. py:class:: WallAlignBackwardBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for WallAlignBackward. Auto-generated — do not edit. .. py:method:: speed(value: float) .. py:method:: accel_threshold(value: float) .. py:method:: settle_duration(value: float) .. py:method:: max_duration(value: float) .. py:method:: grace_period(value: float) .. py:function:: wall_align_backward(speed: float = 1.0, accel_threshold: float = 0.5, settle_duration: float = 0.2, max_duration: float = 5.0, grace_period: float = 0.3) Drive backward into a wall and align the back of the robot. Apply constant backward velocity without heading correction so the robot naturally rotates flush against the wall surface. Uses IMU bump detection to know when the wall has been reached. :param speed: Drive speed in m/s (default 1.0). :param accel_threshold: Minimum XY linear-acceleration magnitude in m/s² to classify as a bump (default 0.5). :param settle_duration: Seconds to keep pushing after impact (default 0.2). :param max_duration: Safety timeout in seconds (default 5.0). :param grace_period: Seconds to ignore acceleration at start (default 0.3). :returns: A WallAlignBackwardBuilder (chainable via ``.speed()``, ``.accel_threshold()``, ``.settle_duration()``, ``.max_duration()``, ``.grace_period()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import wall_align_backward, drive_backward # Drive to the wall in reverse, then align against it seq([drive_backward(30), wall_align_backward()]) .. py:class:: WallAlignStrafeLeftBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for WallAlignStrafeLeft. Auto-generated — do not edit. .. py:method:: speed(value: float) .. py:method:: accel_threshold(value: float) .. py:method:: settle_duration(value: float) .. py:method:: max_duration(value: float) .. py:method:: grace_period(value: float) .. py:function:: wall_align_strafe_left(speed: float = 0.5, accel_threshold: float = 0.5, settle_duration: float = 0.2, max_duration: float = 5.0, grace_period: float = 0.3) Strafe left into a wall and align the left side of the robot. Apply constant leftward velocity without heading correction so the robot naturally rotates flush against the wall surface. Uses IMU bump detection. Requires a mecanum or omni drivetrain capable of lateral movement. :param speed: Strafe speed in m/s (default 0.5). :param accel_threshold: Minimum XY linear-acceleration magnitude in m/s² to classify as a bump (default 0.5). :param settle_duration: Seconds to keep pushing after impact (default 0.2). :param max_duration: Safety timeout in seconds (default 5.0). :param grace_period: Seconds to ignore acceleration at start (default 0.3). :returns: A WallAlignStrafeLeftBuilder (chainable via ``.speed()``, ``.accel_threshold()``, ``.settle_duration()``, ``.max_duration()``, ``.grace_period()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import wall_align_strafe_left # Strafe-align the left side against a wall wall_align_strafe_left(speed=0.4) .. py:class:: WallAlignStrafeRightBuilder Bases: :py:obj:`raccoon.step.step_builder.StepBuilder` Builder for WallAlignStrafeRight. Auto-generated — do not edit. .. py:method:: speed(value: float) .. py:method:: accel_threshold(value: float) .. py:method:: settle_duration(value: float) .. py:method:: max_duration(value: float) .. py:method:: grace_period(value: float) .. py:function:: wall_align_strafe_right(speed: float = 0.5, accel_threshold: float = 0.5, settle_duration: float = 0.2, max_duration: float = 5.0, grace_period: float = 0.3) Strafe right into a wall and align the right side of the robot. Apply constant rightward velocity without heading correction so the robot naturally rotates flush against the wall surface. Uses IMU bump detection. Requires a mecanum or omni drivetrain capable of lateral movement. :param speed: Strafe speed in m/s (default 0.5). :param accel_threshold: Minimum XY linear-acceleration magnitude in m/s² to classify as a bump (default 0.5). :param settle_duration: Seconds to keep pushing after impact (default 0.2). :param max_duration: Safety timeout in seconds (default 5.0). :param grace_period: Seconds to ignore acceleration at start (default 0.3). :returns: A WallAlignStrafeRightBuilder (chainable via ``.speed()``, ``.accel_threshold()``, ``.settle_duration()``, ``.max_duration()``, ``.grace_period()``, ``.on_anomaly()``, ``.skip_timing()``). Example:: from raccoon.step.motion import wall_align_strafe_right # Strafe-align the right side against a wall wall_align_strafe_right(speed=0.4)