CrossTheRoadElec / Phoenix-Releases

Release repository for Phoenix-Framework and Phoenix-Tuner
76 stars 7 forks source link

add support for inverted motors and encoders to SimSwerveDrivetrain #57

Closed gcschmit closed 9 months ago

gcschmit commented 10 months ago

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.

bhall-ctre commented 10 months ago

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