Package swervelib.parser.json
Class DeviceJson
java.lang.Object
swervelib.parser.json.DeviceJson
Device JSON parsed class. Used to access the JSON data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe CAN bus name which the device resides on if using CAN.private final AlertAnAlertfor if the CAN ID is greater than 40.private final AlertAnAlertfor if there is an I2C lockup issue on the roboRIO.intThe CAN ID or pin ID of the device.private final AlertNavX serial comm issue.The device type, e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateEncoder(SwerveMotor motor) Create aSwerveAbsoluteEncoderfrom the current configuration.Create aSwerveIMUfrom the given configuration.createMotor(boolean isDriveMotor) Create aSwerveMotorfrom the given configuration.
-
Field Details
-
canIdWarning
AnAlertfor if the CAN ID is greater than 40. -
i2cLockupWarning
AnAlertfor if there is an I2C lockup issue on the roboRIO. -
serialCommsIssueWarning
NavX serial comm issue. -
type
The device type, e.g. pigeon/pigeon2/sparkmax/talonfx/navx -
id
public int idThe CAN ID or pin ID of the device. -
canbus
The CAN bus name which the device resides on if using CAN.
-
-
Constructor Details
-
DeviceJson
public DeviceJson()
-
-
Method Details
-
createEncoder
Create aSwerveAbsoluteEncoderfrom the current configuration.- Parameters:
motor-SwerveMotorof which attached encoders will be created from, only used when the type is "attached" or "canandencoder".- Returns:
SwerveAbsoluteEncodergiven.
-
createIMU
Create aSwerveIMUfrom the given configuration.- Returns:
SwerveIMUgiven.
-
createMotor
Create aSwerveMotorfrom the given configuration.- Parameters:
isDriveMotor- If the motor being generated is a drive motor.- Returns:
SwerveMotorgiven.
-