Class SwerveParser
java.lang.Object
swervelib.core.parser.SwerveParser
swervelib.commands2.SwerveParser
SwerveParser for WPILib Commands v2. Creates a SwerveDrive whose motor controllers are
bound to the Subsystem of the given SwerveDriveConfig.-
Nested Class Summary
Nested classes/interfaces inherited from class SwerveParser
SwerveParser.SwerveDriveDevices<D>, SwerveParser.SwerveDriveHardware, SwerveParser.SwerveModuleDevices -
Field Summary
Fields inherited from class SwerveParser
moduleJsons, physicalPropertiesJson, pidfPropertiesJson, swerveDriveJson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SwerveDrivecreateSwerveDrive(SwerveDriveConfig swerveDriveConfig) Create aSwerveDrivefrom the parsed JSON configuration.createSwerveDriveDevices(SwerveDriveConfig swerveDriveConfig) Create aSwerveDrivefrom the parsed JSON configuration, exposing the raw vendor hardware devices created along the way (drive/azimuth motor controllers, absolute encoders, and the gyro) alongside it.Methods inherited from class SwerveParser
buildSwerveDrive, parse, parseDirectory, readJson
-
Constructor Details
-
SwerveParser
public SwerveParser()Construct a swerve parser.
-
-
Method Details
-
createSwerveDrive
Create aSwerveDrivefrom the parsed JSON configuration.- Parameters:
swerveDriveConfig-SwerveDriveConfigto apply to the createdSwerveDrive.- Returns:
- Configured
SwerveDrive.
-
createSwerveDriveDevices
public static SwerveParser.SwerveDriveDevices<SwerveDrive> createSwerveDriveDevices(SwerveDriveConfig swerveDriveConfig) Create aSwerveDrivefrom the parsed JSON configuration, exposing the raw vendor hardware devices created along the way (drive/azimuth motor controllers, absolute encoders, and the gyro) alongside it. Useful when code needs direct access to a vendor device for configuration that isn't exposed throughSmartMotorController-- everything else should prefercreateSwerveDrive(SwerveDriveConfig).- Parameters:
swerveDriveConfig-SwerveDriveConfigto apply to the createdSwerveDrive.- Returns:
SwerveParser.SwerveDriveDevicescontaining the configuredSwerveDriveand every raw device created for it.
-