MAXSwerve-Java-Template Question

In the Java template for the MAXSwerve MaxWheelModule file we are confused about the application of the ‘chassisAngularOffset’ variable. In the ‘setDesiredState’ method it is adding the ‘chassisAngularOffset’ when setting the swerve module state’s Rotation2D instead of subtracting it, despite subtracting above in ‘SwerveModulePosition’ and ‘SwerveModuleState’. Can anyone explain why it is being added?

The chassis angular offset is due to how MAXSwerve modules are zeroed.

As seen in the documentation, the modules are all zeroed the same way, which means that when 4 modules are arranged on a robot, the zeroes are not aligned. So an offset must be used in order to make all the wheels point in the same direction to drive together.