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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAsyncServoRotator.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Integercurrentprivate final ServoDevicetheServoprivate final IntRangephysicalRangepublic final static AsyncServoRotator.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description AsyncServoRotator(ServoDevice theServo, IntRange servoRange)Secondary constructor that assumes the servo's physical range matches its servo range. AsyncServoRotator(ServoDevice theServo, IntRange physicalRange, IntRange servoRange)
-
Method Summary
Modifier and Type Method Description IntegergetCurrent()Return some notion of the "current" position/value of the actuator. final ServoDevicegetTheServo()final IntRangegetPhysicalRange()final Unitinit()<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.
-
-
Method Detail
-
getCurrent
Integer getCurrent()
Return some notion of the "current" position/value of the actuator.
-
getTheServo
final ServoDevice getTheServo()
-
getPhysicalRange
final IntRange getPhysicalRange()
-
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.
-
-
-
-