Package crackers.kobots.parts.movement
Class ServoLinearActuator
-
- All Implemented Interfaces:
-
crackers.kobots.parts.movement.Actuator
public class ServoLinearActuator extends LinearActuator
A linear actuator that uses a servo to extend and retract. Due to rounding errors and whatever gearing is applied, the "step" size is basically however far the servo moves the actuator in one degree of rotation.
TODO add a delta to manage the rate of change
-
-
Field Summary
Fields Modifier and Type Field Description private final Integer
current
private final ServoDevice
theServo
private final Float
homeDegrees
private final Float
maximumDegrees
-
Constructor Summary
Constructors Constructor Description ServoLinearActuator(ServoDevice theServo, Float homeDegrees, Float maximumDegrees)
-
Method Summary
Modifier and Type Method Description Integer
getCurrent()
final ServoDevice
getTheServo()
final Float
getHomeDegrees()
final Float
getMaximumDegrees()
Boolean
extendTo(Integer percentage)
Extend or retract the actuator to the given percentage of the total range of motion. -
-
Method Detail
-
getCurrent
Integer getCurrent()
-
getTheServo
final ServoDevice getTheServo()
-
getHomeDegrees
final Float getHomeDegrees()
-
getMaximumDegrees
final Float getMaximumDegrees()
-
-
-
-