Class AsyncServoRotator

  • All Implemented Interfaces:
    crackers.kobots.parts.movement.Actuator

    
    public class AsyncServoRotator
    extends LimitedRotator
                        

    An asynchronous servo rotator that smoothly rotates a servo to a specified angle using easing functions. Do not use this class if you need to interrupt the rotation once started.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncServoRotator(ServoDevice theServo, IntRange servoRange) Secondary constructor that assumes the servo's physical range matches its servo range and uses a delta of 1.
      AsyncServoRotator(ServoDevice theServo, IntRange physicalRange, IntRange servoRange, Integer delta)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Integer getCurrent()
      IntRange getPhysicalRange()
      final Unit init()
      Boolean rotateTo(Integer angle) Rotate to the specified angle synchronously.
      final Unit rotateAsync(Integer angle, Duration time, Function1<Float, Float> easing) Rotate to the specified angle asynchronously with given time and easing.
      • Methods inherited from class crackers.kobots.parts.movement.LimitedRotator

        rem
      • Methods inherited from class crackers.kobots.parts.movement.Rotator

        move
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AsyncServoRotator

        AsyncServoRotator(ServoDevice theServo, IntRange servoRange)
        Secondary constructor that assumes the servo's physical range matches its servo range and uses a delta of 1.
      • AsyncServoRotator

        AsyncServoRotator(ServoDevice theServo, IntRange physicalRange, IntRange servoRange, Integer delta)
        Parameters:
        theServo - The servo device to be controlled.
        physicalRange - The physical range of motion for the servo in degrees.
        servoRange - The actual range of angles the servo can achieve.
        delta - The increment step for rotation.