Package swervelib.parser.json
Class ModuleJson
- java.lang.Object
-
- swervelib.parser.json.ModuleJson
-
public class ModuleJson extends Object
SwerveModuleJSON parsed class. Used to access the JSON data.
-
-
Field Summary
Fields Modifier and Type Field Description booleanabsoluteEncoderInvertedAbsolute encoder inversion state.doubleabsoluteEncoderOffsetAbsolute encoder offset from 0 in degrees.DeviceJsonangleAngle motor device configuration.DeviceJsondriveDrive motor device configuration.DeviceJsonencoderAbsolute encoder device configuration.BoolMotorJsoninvertedDefines which motors are inverted.LocationJsonlocationThe location of the swerve module from the center of the robot in inches.
-
Constructor Summary
Constructors Constructor Description ModuleJson()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SwerveModuleConfigurationcreateModuleConfiguration(PIDFConfig anglePIDF, PIDFConfig velocityPIDF, double maxSpeed, SwerveModulePhysicalCharacteristics physicalCharacteristics)Create the swerve module configuration based off of parsed data.
-
-
-
Field Detail
-
drive
public DeviceJson drive
Drive motor device configuration.
-
angle
public DeviceJson angle
Angle motor device configuration.
-
encoder
public DeviceJson encoder
Absolute encoder device configuration.
-
inverted
public BoolMotorJson inverted
Defines which motors are inverted.
-
absoluteEncoderOffset
public double absoluteEncoderOffset
Absolute encoder offset from 0 in degrees.
-
absoluteEncoderInverted
public boolean absoluteEncoderInverted
Absolute encoder inversion state.
-
location
public LocationJson location
The location of the swerve module from the center of the robot in inches.
-
-
Method Detail
-
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.
-
-