libstp.step.motion.turn ======================= .. py:module:: libstp.step.motion.turn Classes ------- .. autoapisummary:: libstp.step.motion.turn.Turn Functions --------- .. autoapisummary:: libstp.step.motion.turn.turn_left libstp.step.motion.turn.turn_right Module Contents --------------- .. py:class:: Turn(config: libstp.motion.TurnConfig) Bases: :py:obj:`libstp.step.motion.motion_step.MotionStep` Step wrapper around the native `TurnMotion` controller. .. py:attribute:: config .. py:method:: to_simulation_step() -> libstp.step.SimulationStep .. py:method:: on_start(robot: libstp.robot.api.GenericRobot) -> None .. py:method:: on_update(robot: libstp.robot.api.GenericRobot, dt: float) -> bool .. py:function:: turn_left(degrees: float, speed: float = 1.0) -> Turn Turn counter-clockwise (left) by a specified angle. Uses a PID controller on the IMU heading to rotate the robot in place. The controller saturates output at the configured max angular rate, producing an implicit trapezoidal velocity profile. :param degrees: Angle to turn in degrees (positive = counter-clockwise). :param speed: Fraction of max angular speed, 0.0 to 1.0 (default 1.0). :returns: A Turn step configured for counter-clockwise rotation. Example:: from libstp.step.motion import turn_left # Turn 90 degrees to the left turn_left(90) # Gentle 45-degree turn at half speed turn_left(45, speed=0.5) .. py:function:: turn_right(degrees: float, speed: float = 1.0) -> Turn Turn clockwise (right) by a specified angle. Uses a PID controller on the IMU heading to rotate the robot in place. The controller saturates output at the configured max angular rate, producing an implicit trapezoidal velocity profile. :param degrees: Angle to turn in degrees (positive = clockwise). :param speed: Fraction of max angular speed, 0.0 to 1.0 (default 1.0). :returns: A Turn step configured for clockwise rotation. Example:: from libstp.step.motion import turn_right # Turn 90 degrees to the right turn_right(90)