Skip to content

Commit 363ca43

Browse files
committed
Implement Sendable
1 parent 4411ab0 commit 363ca43

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/src/main/java/com/team2813/lib2813/control/motors/PositionalMotor.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import edu.wpi.first.units.Units;
1616
import edu.wpi.first.units.measure.Angle;
1717
import edu.wpi.first.units.measure.Current;
18+
import edu.wpi.first.util.sendable.Sendable;
19+
import edu.wpi.first.util.sendable.SendableBuilder;
1820
import java.util.Objects;
1921
import java.util.function.Supplier;
2022
import org.apiguardian.api.API;
@@ -47,7 +49,7 @@
4749
*/
4850
@API(status = API.Status.EXPERIMENTAL)
4951
public final class PositionalMotor<P extends Enum<P> & Supplier<Angle>>
50-
implements AutoCloseable, Motor {
52+
implements AutoCloseable, Motor, Sendable {
5153
/** The default error tolerance for the controller. */
5254
public static final double DEFAULT_TOLERANCE = 0.05;
5355

@@ -245,6 +247,11 @@ private PositionalMotor(Builder builder, P initialPosition) {
245247
builder.periodicRegistry.addPeriodic(this::periodic);
246248
}
247249

250+
@Override
251+
public void initSendable(SendableBuilder builder) {
252+
controller.initSendable(builder);
253+
}
254+
248255
/**
249256
* Sets the desired setpoint to the provided value, and enables the PID control.
250257
*

0 commit comments

Comments
 (0)