libstp.step.motion.arc¶
Classes¶
Step wrapper around the native ArcMotion controller. |
Functions¶
|
Drive along a circular arc curving to the left. |
|
Drive along a circular arc curving to the right. |
|
Drive along a circular arc with explicit direction. |
Module Contents¶
- class libstp.step.motion.arc.Arc(config: libstp.motion.ArcMotionConfig)¶
Bases:
libstp.step.motion.motion_step.MotionStepStep wrapper around the native ArcMotion controller.
- config¶
- to_simulation_step() libstp.step.SimulationStep¶
Convert this step to a simulation-friendly summary.
The default implementation uses timing history only when it can query the tracker synchronously; otherwise it returns conservative defaults. Override in subclasses that know their motion delta or exact duration.
- on_start(robot: libstp.robot.api.GenericRobot) None¶
Called once before the loop. Override to set up motion/velocity.
- on_update(robot: libstp.robot.api.GenericRobot, dt: float) bool¶
Called each cycle with dt in seconds. Return True when motion is complete.
- libstp.step.motion.arc.drive_arc_left(radius_cm: float, degrees: float, speed: float = 1.0) Arc¶
Drive along a circular arc curving to the left.
The robot drives forward while simultaneously turning counter-clockwise, tracing a circular arc of the given radius. The motion completes when the robot has turned by the specified number of degrees.
- Parameters:
radius_cm – Turning radius in centimeters (center of arc to robot center).
degrees – Arc angle in degrees (how much the robot turns).
speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).
- Returns:
An Arc step configured for a left (CCW) arc.
Example:
from libstp.step.motion import drive_arc_left # Quarter-circle left with 30 cm radius drive_arc_left(radius_cm=30, degrees=90) # Gentle wide arc at half speed drive_arc_left(radius_cm=50, degrees=45, speed=0.5)
- libstp.step.motion.arc.drive_arc_right(radius_cm: float, degrees: float, speed: float = 1.0) Arc¶
Drive along a circular arc curving to the right.
The robot drives forward while simultaneously turning clockwise, tracing a circular arc of the given radius. The motion completes when the robot has turned by the specified number of degrees.
- Parameters:
radius_cm – Turning radius in centimeters (center of arc to robot center).
degrees – Arc angle in degrees (how much the robot turns).
speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).
- Returns:
An Arc step configured for a right (CW) arc.
Example:
from libstp.step.motion import drive_arc_right # Quarter-circle right with 30 cm radius drive_arc_right(radius_cm=30, degrees=90)
- libstp.step.motion.arc.drive_arc(radius_cm: float, degrees: float, speed: float = 1.0) Arc¶
Drive along a circular arc with explicit direction.
Positive degrees = counter-clockwise (left), negative = clockwise (right).
- Parameters:
radius_cm – Turning radius in centimeters (always positive).
degrees – Arc angle in degrees. Positive = left/CCW, negative = right/CW.
speed – Fraction of max speed, 0.0 to 1.0 (default 1.0).
- Returns:
An Arc step.
Example:
from libstp.step.motion import drive_arc # Left arc drive_arc(radius_cm=30, degrees=90) # Right arc drive_arc(radius_cm=30, degrees=-90)