EasyServoGroup
EasyServoGroup bundles servos that move together, such as the two arms of a lift or a dual claw. You control the group as if it were one servo and every command is applied to each servo inside it.
#Creating an EasyServoGroup
Pass the leader and any number of followers. Each servo keeps its own configuration, so a servo that is mounted backwards can be inverted before it joins the group:
Java
EasyServo left = new EasyServo(hardwareMap, "liftLeft").setInverted(true);
EasyServo right = new EasyServo(hardwareMap, "liftRight");
EasyServoGroup lift = new EasyServoGroup(left, right)
.setLimits(0.1, 0.9)
.setCachingTolerance(0.02)
.addState("Down", 0.0)
.addState("Up", 1.0);#Positioning
setPosition(position): moves every servo to the same normalized position.rotateBy(delta): moves every servo by a relative amount.setAngle(angle[, unit]): moves every servo to an angle, when the angle range is configured.turnByAngle(angle[, unit]): turns every servo by a relative angle.setState(name): moves every servo to a named state.
#Unified Configuration
These methods are applied to every servo and return the group, so they can be chained:
setLimits(min, max): the safe travel window.setAngleRange(degrees): the physical sweep of the servos.setCachingTolerance(tolerance): ignore commands that are almost equal to the last one.setSpeed(positionPerSecond): speed used for position estimation.setPwmRange(range): expanded PWM range, for examplePwmPresets.FULL_RANGE.reverse()/setInverted(boolean): inverts the logic of every servo.addState(name, position): defines a named state on every servo.enable()/disable(): restores or cuts power to every servo.
#Reading Data
getPosition(),getRawPosition(): the target position.getAngle([unit]): the current target angle.getEstimatedPosition(): where the servos are estimated to be, when a speed is set.isAtTarget(): true when the estimated position reached the target.getPositions(): the position of each servo as a list.
Use forEachServo(Consumer) to apply your own action to each servo, or iterate over the group directly.
Last updated 2026-11-16