# ModuleJson
declaration: package: swervelib.parser.json, class: ModuleJson

Package swervelib.parser.json

# Class ModuleJson

java.lang.Object
swervelib.parser.json.ModuleJson

public class ModuleJson extends Object
`SwerveModule` JSON parsed class. Used to access the JSON data.

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`absoluteEncoderInverted`
Absolute encoder inversion state.
`double`
`absoluteEncoderOffset`
Absolute encoder offset from 0 in degrees.
`DeviceJson`
`angle`
Angle motor device configuration.
`MotorConfigDouble`
`conversionFactor`
Conversion factor for the module, if different from the one in swervedrive.json
`DeviceJson`
`drive`
Drive motor device configuration.
`DeviceJson`
`encoder`
Absolute encoder device configuration.
`BoolMotorJson`
`inverted`
Defines which motors are inverted.
`LocationJson`
`location`
The location of the swerve module from the center of the robot in inches.

## Constructor Summary

Constructors
Constructor
Description
`ModuleJson()`

## Method Summary

Modifier and Type
Method
Description
`SwerveModuleConfiguration`
`createModuleConfiguration(PIDFConfig anglePIDF, PIDFConfig velocityPIDF, SwerveModulePhysicalCharacteristics physicalCharacteristics, String name)`
Create the swerve module configuration based off of parsed data.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### drive

public DeviceJson drive
Drive motor device configuration.

### angle

public DeviceJson angle
Angle motor device configuration.

### conversionFactor

public MotorConfigDouble conversionFactor
Conversion factor for the module, if different from the one in swervedrive.json

Conversion factor applied to the motor controllers PID loops. Can be calculated with `SwerveMath.calculateDegreesPerSteeringRotation(double, double)` for angle motors or `SwerveMath.calculateMetersPerRotation(double, double, double)` for drive motors.

### 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.

## Constructor Details

### ModuleJson

public ModuleJson()

## Method Details

### createModuleConfiguration

public SwerveModuleConfiguration createModuleConfiguration(PIDFConfig anglePIDF, PIDFConfig velocityPIDF, SwerveModulePhysicalCharacteristics physicalCharacteristics, String name)
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.
  `physicalCharacteristics` - Physical characteristics of the swerve module.
  `name` - Module json filename.
Returns:
  `SwerveModuleConfiguration` based on the provided data and parsed data.