Class SwerveDrivetrainConstants

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

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

    • Pigeon2Id

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

      Name of the CAN bus the swerve drive is on. Possible CAN bus strings are:
      • "rio" for the native roboRIO CAN bus
      • CANivore name or serial number
      • "*" for any CANivore seen by the program
    • Pigeon2Configs

      The Pigeon2 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 non-null, the Pigeon2 will be overwritten with these configs.
  • Constructor Details

  • Method Details

    • withPigeon2Id

      Sets the CAN ID of the Pigeon2 on the drivetrain.
      Parameters:
      id - CAN ID of the Pigeon2 on the drivetrain
      Returns:
      this object
    • withCANbusName

      Sets the name of the CAN bus the swerve drive is on. Possible CAN bus strings are:
      • "rio" for the native roboRIO CAN bus
      • CANivore name or serial number
      • "*" for any CANivore seen by the program
      Parameters:
      name - Name of the CAN bus the swerve drive is on
      Returns:
      this object
    • withPigeon2Configs

      The Pigeon2 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 non-null, the Pigeon2 will be overwritten with these configs.
      Parameters:
      configs - The configs to apply to the Pigeon2
      Returns:
      this object