Class SwerveDrivetrain

java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.SwerveDrivetrain

public class SwerveDrivetrain
extends Object
Swerve Drive class utilizing CTR Electronics' Phoenix 6 API.

This class handles the kinematics, configuration, and odometry of a swerve drive utilizing CTR Electronics devices. We recommend that users use the Swerve Mechanism Generator in Tuner X to create a template project that demonstrates how to use this class.

This class will construct the hardware devices internally, so the user only specifies the constants (IDs, PID gains, gear ratios, etc). Getters for these hardware devices are available.

If using the generator, the order in which modules are constructed is Front Left, Front Right, Back Left, Back Right. This means if you need the Back Left module, call getModule(2); to get the 3rd index (0-indexed) module, corresponding to the Back Left module.