Package com.ctre.phoenix6.swerve
Class SwerveDrivetrainConstants
java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrainConstants
Common constants for a swerve drivetrain.
-
Field Summary
FieldsModifier and TypeFieldDescriptionName of the CAN bus 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 TypeMethodDescriptionwithCANBusName(String newCANBusName) Modifies the CANBusName 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
-
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
- SocketCAN interface (non-FRC Linux only)
- "*" for any CANivore seen by the program
- empty string (default) to select the default for the system:
- "rio" on roboRIO
- "can0" on Linux
- "*" on Windows
-
Pigeon2Id
CAN 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
-
withCANBusName
Modifies the CANBusName parameter and returns itself.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
- SocketCAN interface (non-FRC Linux only)
- "*" for any CANivore seen by the program
- empty string (default) to select the default for the system:
- "rio" on roboRIO
- "can0" on Linux
- "*" on Windows
- Parameters:
newCANBusName- 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
-