:py:mod:`phoenix6.swerve.swerve_drivetrain_constants` ===================================================== .. py:module:: phoenix6.swerve.swerve_drivetrain_constants Module Contents --------------- .. py:class:: SwerveDrivetrainConstants Common constants for a swerve drivetrain. .. py:attribute:: can_bus_name :type: str :value: 'rio' Name of the CAN bus the swerve drive is on. Possible CAN bus strings are: - empty string or "rio" for the native roboRIO CAN bus - CANivore name or serial number - "*" for any CANivore seen by the program Note that all devices must be on the same CAN bus. .. py:attribute:: pigeon2_id :type: int :value: 0 CAN ID of the Pigeon2 on the drivetrain. .. py:attribute:: pigeon2_configs :type: None | phoenix6.configs.Pigeon2Configuration 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. .. py:method:: with_can_bus_name(new_can_bus_name: str) -> SwerveDrivetrainConstants Modifies the can_bus_name parameter and returns itself. Name of the CAN bus the swerve drive is on. Possible CAN bus strings are: - empty string or "rio" for the native roboRIO CAN bus - CANivore name or serial number - "*" for any CANivore seen by the program Note that all devices must be on the same CAN bus. :param new_can_bus_name: Parameter to modify :type new_can_bus_name: str :returns: this object :rtype: SwerveDrivetrainConstants .. py:method:: with_pigeon2_id(new_pigeon2_id: int) -> SwerveDrivetrainConstants Modifies the pigeon2_id parameter and returns itself. CAN ID of the Pigeon2 on the drivetrain. :param new_pigeon2_id: Parameter to modify :type new_pigeon2_id: int :returns: this object :rtype: SwerveDrivetrainConstants .. py:method:: with_pigeon2_configs(new_pigeon2_configs: None | phoenix6.configs.Pigeon2Configuration) -> SwerveDrivetrainConstants Modifies the pigeon2_configs 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. :param new_pigeon2_configs: Parameter to modify :type new_pigeon2_configs: None | Pigeon2Configuration :returns: this object :rtype: SwerveDrivetrainConstants