Skip to content

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 into
masterfrom
talonfx-follower-slot-and-vendor-config
Oct 29, 2026
Merged

thenetworkgrinch merged 4 commits into
masterfrom
talonfx-follower-slot-and-vendor-config

Conversation

@thenetworkgrinch

@thenetworkgrinch thenetworkgrinch commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

TalonFXWrapper.setClosedLoopSlot now passes the slot on to the motor controllers from withLooselyCoupledFollowers(...), 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 the TalonFXConfiguration (or TalonFXSConfiguration) given to withVendorConfig(...) in applyConfig, 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 the applyConfig and withResetPreviousConfig javadoc.

  • 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.
  • New VendorConfigTest: with withResetPreviousConfig(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 passed

Without the wrapper changes, the new tests fail for the TalonFX: followerSwitchesSlotWithItsLeader (TalonFX) and vendorConfigWinsOverTheSavedSettings (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.

thenetworkgrinch and others added 4 commits October 29, 2026 15:46
…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.
@thenetworkgrinch
thenetworkgrinch merged commit 933300b into master Oct 29, 2026
20 of 21 checks passed
@thenetworkgrinch
thenetworkgrinch deleted the talonfx-follower-slot-and-vendor-config branch October 29, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant