Class SwerveDrivetrainConstants
java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrainConstants
Common constants for a swerve drivetrain.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe network the swerve drive is on.The configuration object to apply to the Pigeon2.intCAN ID of the Pigeon2 on the drivetrain. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwithNetwork(CANBus newNetwork) Modifies the Network parameter and returns itself.withPigeon2Configs(Pigeon2Configuration newPigeon2Configs) Modifies the Pigeon2Configs parameter and returns itself.withPigeon2Id(int newPigeon2Id) Modifies the Pigeon2Id parameter and returns itself.
-
Field Details
-
Network
The network the swerve drive is on. Note that all devices must be on the same CAN bus. -
Pigeon2Id
public int Pigeon2IdCAN ID of the Pigeon2 on the drivetrain. -
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
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
Modifies the Pigeon2Id parameter and returns itself.CAN ID of the Pigeon2 on the drivetrain.
- Parameters:
newPigeon2Id- Parameter to modify- Returns:
- this object
-
withPigeon2Configs
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
-