Repository navigation
Pass a TalonFX's closed loop slot to its followers, and let a Talon vendor config win over the device's saved settings - #249
Merged
thenetworkgrinch merged 4 commits intoOct 29, 2026
Conversation
…endor config win over the device's saved settings TalonFXWrapper.setClosedLoopSlot now passes the slot on to its loosely coupled followers, as the TalonFXS, SPARK and Nova wrappers already did. With withResetPreviousConfig(false), the Java TalonFX and TalonFXS wrappers no longer read the device's saved settings into a supplied vendor config, which replaced its settings; the vendor config is now the base, as it already was in C++.
…eadband's resolution in the new tests The new slot and vendor config tests closed subsystems with no motor controller set, and compared the device's deadband exactly, though the device stores it in steps of about 0.0004.
The previous commit dropped the v2026.10.15 fixes when it added the TalonFX ones. They are back, below the TalonFX fixes, in the one Fixes section under Updating from v2026.10.15.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TalonFXWrapper.setClosedLoopSlotnow passes the slot on to the motor controllers fromwithLooselyCoupledFollowers(...), so a follower switches gains with its leader. The TalonFXS, SPARK and Thrifty Nova wrappers already did this, as did every C++ wrapper.With
withResetPreviousConfig(false), the Java TalonFX and TalonFXS wrappers read the device's saved settings into theTalonFXConfiguration(orTalonFXSConfiguration) given towithVendorConfig(...)inapplyConfig, which replaced the vendor config's settings with whatever was saved on the device. They now only read the saved settings when there is no vendor config, so a vendor config is the base, as it already was in C++. The behaviour is described in theapplyConfigandwithResetPreviousConfigjavadoc.MIGRATION.md: a Fixes section under "Updating from v2026.10.15" with both changes.LooselyCoupledFollowerTest.followerSwitchesSlotWithItsLeader: a SPARK MAX follower switches slot with a SPARK MAX, SPARK Flex, TalonFX, TalonFXS or Nova leader.VendorConfigTest: withwithResetPreviousConfig(false), a TalonFX or TalonFXS keeps a setting YAMS does not manage (the duty cycle neutral deadband) that was saved on the device, and a vendor config's value for it wins over the saved one, at construction and when the config is applied again.The C++ wrappers needed no change.
Tested, one group at a time with
./gradlew test --rerun --tests <group>:*VendorConfigTest*: 4 passed*LooselyCoupledFollowerTest*: 9 passed*ClosedLoopSlotTest*: 34 passed*CANdiTest*: 18 passed*ContinuousWrappingTest*: 77 passed*AbsoluteEncoder*: 100 passed*ThroughBoreEncoderTest*: 26 passed*TalonFX*: 7 passedWithout the wrapper changes, the new tests fail for the TalonFX:
followerSwitchesSlotWithItsLeader(TalonFX) andvendorConfigWinsOverTheSavedSettings(TalonFX). The TalonFXS vendor config case passed before the fix too, so it only guards against a regression there. The full Java suite, the C++ tests and the examples were not run, and nothing was tried on hardware.