From cee1d946fc18f8e62db0e70f3a4a28ed74cc4413 Mon Sep 17 00:00:00 2001 From: thenetworkgrinch Date: Thu, 5 Mar 2026 06:19:12 -0600 Subject: [PATCH] Added small flywheel fix and talonfx reorg. Signed-off-by: thenetworkgrinch --- yams/java/yams/mechanisms/velocity/FlyWheel.java | 2 +- .../java/yams/motorcontrollers/remote/TalonFXWrapper.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yams/java/yams/mechanisms/velocity/FlyWheel.java b/yams/java/yams/mechanisms/velocity/FlyWheel.java index b24dc825..1ce61706 100644 --- a/yams/java/yams/mechanisms/velocity/FlyWheel.java +++ b/yams/java/yams/mechanisms/velocity/FlyWheel.java @@ -241,7 +241,7 @@ public Command run(Supplier velocity) { m_config.getCircumference(); // Circumference check return Commands.startRun(m_smc::startClosedLoopController, - () -> m_config.getAngularVelocity((LinearVelocity) velocity.get()), + () -> m_smc.setVelocity(m_config.getAngularVelocity((LinearVelocity) velocity.get())), m_subsystem) .withName(cmdName); } diff --git a/yams/java/yams/motorcontrollers/remote/TalonFXWrapper.java b/yams/java/yams/motorcontrollers/remote/TalonFXWrapper.java index 5965fac4..1df56551 100644 --- a/yams/java/yams/motorcontrollers/remote/TalonFXWrapper.java +++ b/yams/java/yams/motorcontrollers/remote/TalonFXWrapper.java @@ -1368,8 +1368,8 @@ public void setMechanismUpperLimit(Angle upperLimit) m_config.getMechanismLowerLimit().ifPresent(lowerLimit -> { m_config.withSoftLimit(lowerLimit, upperLimit); }); - m_talonConfig.SoftwareLimitSwitch.withForwardSoftLimitThreshold(upperLimit) - .withForwardSoftLimitEnable(true); + m_talonConfig.SoftwareLimitSwitch.withForwardSoftLimitEnable(true) + .withForwardSoftLimitThreshold(upperLimit); forceConfigApply(); } @@ -1379,8 +1379,8 @@ public void setMechanismLowerLimit(Angle lowerLimit) m_config.getMechanismUpperLimit().ifPresent(upperLimit -> { m_config.withSoftLimit(lowerLimit, upperLimit); }); - m_talonConfig.SoftwareLimitSwitch.withReverseSoftLimitThreshold(lowerLimit) - .withReverseSoftLimitEnable(true); + m_talonConfig.SoftwareLimitSwitch.withReverseSoftLimitEnable(true) + .withReverseSoftLimitThreshold(lowerLimit); forceConfigApply(); }