This happens when you input module locations incorrectly due to where the gyroscope is oriented on the robot or you have the wrong CANID's in the wrong relative location of the robot. If this happens to you, you HAVE misconfigured your modules.
Challenge
Here is a challenge for you, how can you solve this misconfiguration?
To correctly get the absoluteEncoderOffset your swerve modules must be facing this way while reading the values.
Configuration Directory
JSON Files
JSON stands for "JavaScript Object Notation" it is a popular format for configuration, and string data representation. Learn more here
What does the swerve directory need to look like?
The swerve directory for generating a swerve drive must look like this. Assuming you have defined your swerve modules as "modules": [ "frontleft.json", "frontright.json", "backleft.json", "backright.json"] in swervedrive.json.
Delete wheelDiamter, gearRatio, encoderPulsePerRotation from physicalproperties.json
Add optimalVoltage to physicalproperties.json
Delete maxSpeed and optimalVoltage from swervedrive.json
IF a swerve module doesn't have the same drive motor or steering motor as the rest of the swerve drive you MUST specify a conversionFactor for BOTH the drive and steering motor in the modules configuration JSON file. IF one of the motors is the same as the rest of the swerve drive and you want to use that conversionFactor, set the conversionFactor in the module JSON configuration to 0.
You MUST specify the maximum speed when creating a SwerveDrive through new SwerveParser(directory).createSwerveDrive(maximumSpeed);
IF you do not want to set conversionFactor in swervedrive.json. You can pass it into the constructor as a parameter like this