Class SwerveDrivetrainConstants
java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.SwerveDrivetrainConstants
public class SwerveDrivetrainConstants extends Object
Common constants for a swerve drivetrain.
-
Field Summary
Fields Modifier and Type Field Description String
CANbusName
Name of the CAN bus the swerve drive is on.Pigeon2Configuration
Pigeon2Configs
The Pigeon2 configuration object to apply to the Pigeon2.int
Pigeon2Id
CAN ID of the Pigeon2 on the drivetrain. -
Constructor Summary
Constructors Constructor Description SwerveDrivetrainConstants()
-
Method Summary
Modifier and Type Method Description SwerveDrivetrainConstants
withCANbusName(String name)
Sets the name of the CAN bus the swerve drive is on.SwerveDrivetrainConstants
withPigeon2Configs(Pigeon2Configuration configs)
The Pigeon2 configuration object to apply to the Pigeon2.SwerveDrivetrainConstants
withPigeon2Id(int id)
Sets the CAN ID of the Pigeon2 on the drivetrain.
-
Field Details
-
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
-