CrossTheRoadElec/Phoenix-Releases

add support for inverted motors and encoders to SimSwerveDrivetrain

Closed this issue · 1 comments

When testing new swerve code in simulation (24.0.0-beta-3), the swerve modules would continually rotate and never reach their reference position. I believe this is due to the SimSwerveDrivetrain not supporting swerve modules where the steer motor is inverted. If I changed my configuration such that the steer motor was not inverted (just for testing), the simulation worked as expected.

When I implemented simulation for swerve modules with Phoenix 6, I had to check if the drive motor, steer motor, or encoder were inverted and set the appropriate value for the Orientation property of the corresponding sim state.

This should now be fixed in the 2024 beta-4 release of Phoenix 6: https://api.ctr-electronics.com/changelog#20231205