Class DeviceJson
- java.lang.Object
-
- frc.robot.subsystems.swervedrive2.swervelib.parser.json.DeviceJson
-
public class DeviceJson extends Object
Device JSON parsed class. Used to access the JSON data.
-
-
Constructor Summary
Constructors Constructor Description DeviceJson()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SwerveAbsoluteEncodercreateEncoder()Create aSwerveAbsoluteEncoderfrom the current configuration.SwerveIMUcreateIMU()Create aSwerveIMUfrom the given configuration.SwerveAbsoluteEncodercreateIntegratedEncoder(SwerveMotor motor)Create aSwerveAbsoluteEncoderfrom the data port on the motor controller.SwerveMotorcreateMotor(boolean isDriveMotor)Create aSwerveMotorfrom the given configuration.
-
-
-
Method Detail
-
createEncoder
public SwerveAbsoluteEncoder createEncoder()
Create aSwerveAbsoluteEncoderfrom the current configuration.- Returns:
SwerveAbsoluteEncodergiven.
-
createIMU
public SwerveIMU createIMU()
Create aSwerveIMUfrom the given configuration.- Returns:
SwerveIMUgiven.
-
createMotor
public SwerveMotor createMotor(boolean isDriveMotor)
Create aSwerveMotorfrom the given configuration.- Parameters:
isDriveMotor- If the motor being generated is a drive motor.- Returns:
SwerveMotorgiven.
-
createIntegratedEncoder
public SwerveAbsoluteEncoder createIntegratedEncoder(SwerveMotor motor)
Create aSwerveAbsoluteEncoderfrom the data port on the motor controller.- Parameters:
motor- The motor to create the absolute encoder from.- Returns:
SwerveAbsoluteEncoderfrom the motor controller.
-
-