libstp.step.motion.drive_angle ============================== .. py:module:: libstp.step.motion.drive_angle Classes ------- .. autoapisummary:: libstp.step.motion.drive_angle.DriveAngle Functions --------- .. autoapisummary:: libstp.step.motion.drive_angle.drive_angle Module Contents --------------- .. py:class:: DriveAngle(config: libstp.motion.DiagonalMotionConfig) Bases: :py:obj:`libstp.step.motion.motion_step.MotionStep` .. 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:: drive_angle(angle_deg: float, cm: float, speed: float = 1.0) -> DriveAngle Drive at an arbitrary angle for a specified distance. 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. :param speed: Fraction of max speed, 0.0 to 1.0 (default 1.0). :returns: A DriveAngle step. Example:: from libstp.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)