Package swervelib.parser.json
Class ModuleJson
java.lang.Object
swervelib.parser.json.ModuleJson
SwerveModule JSON parsed class. Used to access the JSON data.-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanAbsolute encoder inversion state.doubleAbsolute encoder offset from 0 in degrees.Angle motor device configuration.doubleThe angle encoder pulse per revolution override.doubleAngle motor free speed RPM.Drive motor device configuration.Absolute encoder device configuration.Defines which motors are inverted.The location of the swerve module from the center of the robot in inches. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateModuleConfiguration(PIDFConfig anglePIDF, PIDFConfig velocityPIDF, double maxSpeed, SwerveModulePhysicalCharacteristics physicalCharacteristics) Create the swerve module configuration based off of parsed data.
-
Field Details
-
drive
Drive motor device configuration. -
angle
Angle motor device configuration. -
encoder
Absolute encoder device configuration. -
inverted
Defines which motors are inverted. -
absoluteEncoderOffset
public double absoluteEncoderOffsetAbsolute encoder offset from 0 in degrees. -
absoluteEncoderInverted
public boolean absoluteEncoderInvertedAbsolute encoder inversion state. -
angleEncoderPulsePerRevolution
public double angleEncoderPulsePerRevolutionThe angle encoder pulse per revolution override. 1 for Neo encoder. 2048 for Falcons. -
angleMotorFreeSpeedRPM
public double angleMotorFreeSpeedRPMAngle motor free speed RPM. -
location
The location of the swerve module from the center of the robot in inches.
-
-
Constructor Details
-
ModuleJson
public ModuleJson()
-
-
Method Details
-
createModuleConfiguration
public SwerveModuleConfiguration createModuleConfiguration(PIDFConfig anglePIDF, PIDFConfig velocityPIDF, double maxSpeed, SwerveModulePhysicalCharacteristics physicalCharacteristics) Create the swerve module configuration based off of parsed data.- Parameters:
anglePIDF- The PIDF values for the angle motor.velocityPIDF- The velocity PIDF values for the drive motor.maxSpeed- The maximum speed of the robot in meters per second.physicalCharacteristics- Physical characteristics of the swerve module.- Returns:
SwerveModuleConfigurationbased on the provided data and parsed data.
-