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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateEncoder
(SwerveMotor motor) Create aSwerveAbsoluteEncoder
from the current configuration.Create aSwerveIMU
from the given configuration.createMotor
(boolean isDriveMotor) Create aSwerveMotor
from the given configuration.
-
Field Details
-
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 aSwerveAbsoluteEncoder
from the current configuration.- Parameters:
motor
-SwerveMotor
of which attached encoders will be created from, only used when the type is "attached" or "canandencoder".- Returns:
SwerveAbsoluteEncoder
given.
-
createIMU
Create aSwerveIMU
from the given configuration.- Returns:
SwerveIMU
given.
-
createMotor
Create aSwerveMotor
from the given configuration.- Parameters:
isDriveMotor
- If the motor being generated is a drive motor.- Returns:
SwerveMotor
given.
-