Class AsyncServoRotator

  • All Implemented Interfaces:
    crackers.kobots.parts.movement.async.AsyncActuator , crackers.kobots.parts.movement.async.AsyncRotator

    
    public class AsyncServoRotator
     implements AsyncRotator
                        

    An asynchronous servo rotator that smoothly rotates a servo to a specified angle using easing functions.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Integer getCurrent() Return some notion of the "current" position/value of the actuator.
      final ServoDevice getTheServo()
      final IntRange getPhysicalRange()
      final Unit init()
      <Error class: unknown class> 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.async.AsyncRotator

        smoothMove, softLanding, softLaunch
      • Methods inherited from class crackers.kobots.parts.movement.async.AsyncActuator

        myLittleKillSwitch, stopCheck
      • 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.
      • AsyncServoRotator

        AsyncServoRotator(ServoDevice theServo, IntRange physicalRange, IntRange servoRange)
        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.
    • Method Detail

      • getCurrent

         Integer getCurrent()

        Return some notion of the "current" position/value of the actuator.

      • rotateAsync

         <Error class: unknown class> rotateAsync(Integer angle, Duration time, Function1<Float, Float> easing)

        Rotate to the specified angle asynchronously with given time and easing.

        Parameters:
        angle - Target angle to rotate to.
        time - Duration of the rotation.
        easing - Easing function to use for the rotation.