diff --git a/src/main/java/org/murraybridgebunyips/bunyipslib/Motor.java b/src/main/java/org/murraybridgebunyips/bunyipslib/Motor.java index 6e54da478..d38e20f47 100644 --- a/src/main/java/org/murraybridgebunyips/bunyipslib/Motor.java +++ b/src/main/java/org/murraybridgebunyips/bunyipslib/Motor.java @@ -237,6 +237,7 @@ public void setVelocity(double vel, AngleUnit unit) { */ @Override public void setPower(double power) { + // TODO: currently not working, needs testing switch (mode) { case RUN_TO_POSITION: if (rtpController == null) { diff --git a/src/main/java/org/murraybridgebunyips/bunyipslib/drive/MecanumDrive.java b/src/main/java/org/murraybridgebunyips/bunyipslib/drive/MecanumDrive.java index 84218bd9a..c27d068d2 100644 --- a/src/main/java/org/murraybridgebunyips/bunyipslib/drive/MecanumDrive.java +++ b/src/main/java/org/murraybridgebunyips/bunyipslib/drive/MecanumDrive.java @@ -60,6 +60,15 @@ public MecanumDrive(DriveConstants constants, MecanumCoefficients mecanumCoeffic updatePoseFromMemory(); } +// public MecanumDrive useFallbackLocalizer() { +// return this; +// } +// +// public MecanumDrive useFallbackLocalizer(Localizer fallback) { +// // TODO: part of SwitchableLocalizer, may need to reconsider Localizers for drives as they are common +// return this; +// } + /** * Reset the IMU's yaw to 0. */ diff --git a/src/main/java/org/murraybridgebunyips/bunyipslib/roadrunner/drive/localizers/SwitchableLocalizer.java b/src/main/java/org/murraybridgebunyips/bunyipslib/roadrunner/drive/localizers/SwitchableLocalizer.java new file mode 100644 index 000000000..527a9578c --- /dev/null +++ b/src/main/java/org/murraybridgebunyips/bunyipslib/roadrunner/drive/localizers/SwitchableLocalizer.java @@ -0,0 +1,10 @@ +package org.murraybridgebunyips.bunyipslib.roadrunner.drive.localizers; + +/** + * SwitchableLocalizer is a composite localizer that allows self-tests to be performed, and to allow a "fallback" + * localizer to kick in if the self-test fails. + * + * @author Lucas Bubner, 2024 + */ +/* TODO: WIP */ class SwitchableLocalizer { +} diff --git a/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/HoldableActuator.java b/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/HoldableActuator.java index 6541c4d3f..8e61beb68 100644 --- a/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/HoldableActuator.java +++ b/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/HoldableActuator.java @@ -384,7 +384,7 @@ public class Tasks { * @return a task to move the actuator */ public Task control(DoubleSupplier powerSupplier) { - return new ContinuousTask(() -> setPower(powerSupplier.getAsDouble())) + return new ContinuousTask(() -> HoldableActuator.this.setPower(powerSupplier.getAsDouble())) .onSubsystem(HoldableActuator.this, false) .withName("Supplier Control"); } @@ -396,7 +396,7 @@ public Task control(DoubleSupplier powerSupplier) { * @return a task to set the power */ public Task setPower(double p) { - return new RunTask(() -> setPower(p)) + return new RunTask(() -> HoldableActuator.this.setPower(p)) .onSubsystem(HoldableActuator.this, false) .withName("Set Power"); }