libstp.step.servo.utility ========================= .. py:module:: libstp.step.servo.utility Functions --------- .. autoapisummary:: libstp.step.servo.utility.clamp_angle libstp.step.servo.utility.clamp_position libstp.step.servo.utility.estimate_servo_move_time libstp.step.servo.utility.angle_to_position libstp.step.servo.utility.position_to_angle Module Contents --------------- .. py:function:: clamp_angle(angle: float) -> float Clamp an angle to the supported servo range. .. py:function:: clamp_position(position: float) -> float Clamp a servo position to the supported range. .. py:function:: estimate_servo_move_time(start_angle: float, end_angle: float) -> float Estimate time (in seconds) for a servo to move between two angles. Returns 0 when the delta is zero to avoid unnecessary sleeps. .. py:function:: angle_to_position(angle: float) -> int Convert an angle (degrees) to the HAL position representation. Currently this is a 1:1 mapping onto degrees with clamping. .. py:function:: position_to_angle(position: int) -> float Convert a HAL position reading to an angle in degrees.