BroncBotz3481/YAGSL-Example

2024 TalonFX conversion factor needs to be inverted

Closed this issue · 1 comments

TalonFX's SensorToMechanismRatio is currently being set with equations where the gear ratio is in the denominator. However, in the Phoenix 6 documentation, SensorToMechanismRatio requires gear ratio to be in the numerator. Currently, the code is basically setting it as a mechanism-to-sensor ratio, rather than a sensor-to-mechanism ratio.

We were able to work around this issue by flipping around the equation in our configuration, but the code or YAGSL documentation should be changed to reflect this.

Here's our working YAGSL swerve repo, here's our configuration file with the flipped conversions.
We're running Falcon 500 for both drive and angle motors, CANCoder for our encoders. MK4 SDS modules with L1 gears.

Can you make a PR to fix this in code?

Thank you for bringing this to my attention!