Class SwerveDrivetrainConstants

java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrainConstants

public class SwerveDrivetrainConstants extends Object
Common constants for a swerve drivetrain.
  • Field Details

    • Network

      public CANBus Network
      The network the swerve drive is on. Note that all devices must be on the same CAN bus.
    • Pigeon2Id

      public int Pigeon2Id
      CAN ID of the Pigeon2 on the drivetrain.
    • Pigeon2Configs

      public Pigeon2Configuration Pigeon2Configs
      The configuration object to apply to the Pigeon2. This defaults to null. If this remains null, then the Pigeon2 will not be configured (and whatever configs are on it remain on it). If this is not null, the Pigeon2 will be overwritten with these configs.
  • Constructor Details

    • SwerveDrivetrainConstants

      public SwerveDrivetrainConstants()
  • Method Details

    • withNetwork

      public final SwerveDrivetrainConstants withNetwork(CANBus newNetwork)
      Modifies the Network parameter and returns itself.

      The network the swerve drive is on. Note that all devices must be on the same CAN bus.

      Parameters:
      newNetwork - Parameter to modify
      Returns:
      this object
    • withPigeon2Id

      public final SwerveDrivetrainConstants withPigeon2Id(int newPigeon2Id)
      Modifies the Pigeon2Id parameter and returns itself.

      CAN ID of the Pigeon2 on the drivetrain.

      Parameters:
      newPigeon2Id - Parameter to modify
      Returns:
      this object
    • withPigeon2Configs

      public final SwerveDrivetrainConstants withPigeon2Configs(Pigeon2Configuration newPigeon2Configs)
      Modifies the Pigeon2Configs parameter and returns itself.

      The configuration object to apply to the Pigeon2. This defaults to null. If this remains null, then the Pigeon2 will not be configured (and whatever configs are on it remain on it). If this is not null, the Pigeon2 will be overwritten with these configs.

      Parameters:
      newPigeon2Configs - Parameter to modify
      Returns:
      this object