CTRE Phoenix 6 C++ 25.1.0
Loading...
Searching...
No Matches
ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename > Struct Template Reference

All constants for a swerve module. More...

#include <ctre/phoenix6/swerve/SwerveModuleConstants.hpp>

Public Member Functions

constexpr SwerveModuleConstants ()=default
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorId (int newSteerMotorId)
 Modifies the SteerMotorId parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorId (int newDriveMotorId)
 Modifies the DriveMotorId parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderId (int newEncoderId)
 Modifies the EncoderId parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderOffset (units::angle::turn_t newEncoderOffset)
 Modifies the EncoderOffset parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithLocationX (units::length::meter_t newLocationX)
 Modifies the LocationX parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithLocationY (units::length::meter_t newLocationY)
 Modifies the LocationY parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorInverted (bool newDriveMotorInverted)
 Modifies the DriveMotorInverted parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorInverted (bool newSteerMotorInverted)
 Modifies the SteerMotorInverted parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderInverted (bool newEncoderInverted)
 Modifies the EncoderInverted parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorGearRatio (units::dimensionless::scalar_t newDriveMotorGearRatio)
 Modifies the DriveMotorGearRatio parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorGearRatio (units::dimensionless::scalar_t newSteerMotorGearRatio)
 Modifies the SteerMotorGearRatio parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithCouplingGearRatio (units::dimensionless::scalar_t newCouplingGearRatio)
 Modifies the CouplingGearRatio parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithWheelRadius (units::length::meter_t newWheelRadius)
 Modifies the WheelRadius parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorGains (const configs::Slot0Configs &newSteerMotorGains)
 Modifies the SteerMotorGains parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorGains (const configs::Slot0Configs &newDriveMotorGains)
 Modifies the DriveMotorGains parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorClosedLoopOutput (ClosedLoopOutputType newSteerMotorClosedLoopOutput)
 Modifies the SteerMotorClosedLoopOutput parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorClosedLoopOutput (ClosedLoopOutputType newDriveMotorClosedLoopOutput)
 Modifies the DriveMotorClosedLoopOutput parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSlipCurrent (units::current::ampere_t newSlipCurrent)
 Modifies the SlipCurrent parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSpeedAt12Volts (units::velocity::meters_per_second_t newSpeedAt12Volts)
 Modifies the SpeedAt12Volts parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorType (DriveMotorArrangement newDriveMotorType)
 Modifies the DriveMotorType parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorType (SteerMotorArrangement newSteerMotorType)
 Modifies the SteerMotorType parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithFeedbackSource (SteerFeedbackType newFeedbackSource)
 Modifies the FeedbackSource parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorInitialConfigs (const DriveMotorConfigsT &newDriveMotorInitialConfigs)
 Modifies the DriveMotorInitialConfigs parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorInitialConfigs (const SteerMotorConfigsT &newSteerMotorInitialConfigs)
 Modifies the SteerMotorInitialConfigs parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderInitialConfigs (const EncoderConfigsT &newEncoderInitialConfigs)
 Modifies the EncoderInitialConfigs parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerInertia (units::moment_of_inertia::kilogram_square_meter_t newSteerInertia)
 Modifies the SteerInertia parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveInertia (units::moment_of_inertia::kilogram_square_meter_t newDriveInertia)
 Modifies the DriveInertia parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerFrictionVoltage (units::voltage::volt_t newSteerFrictionVoltage)
 Modifies the SteerFrictionVoltage parameter and returns itself.
 
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveFrictionVoltage (units::voltage::volt_t newDriveFrictionVoltage)
 Modifies the DriveFrictionVoltage parameter and returns itself.
 

Public Attributes

int SteerMotorId = 0
 CAN ID of the steer motor.
 
int DriveMotorId = 0
 CAN ID of the drive motor.
 
int EncoderId = 0
 CAN ID of the absolute encoder used for azimuth.
 
units::angle::turn_t EncoderOffset = 0_tr
 Offset of the azimuth encoder.
 
units::length::meter_t LocationX = 0_m
 The location of this module's wheels relative to the physical center of the robot in meters along the X axis of the robot.
 
units::length::meter_t LocationY = 0_m
 The location of this module's wheels relative to the physical center of the robot in meters along the Y axis of the robot.
 
bool DriveMotorInverted = false
 True if the drive motor is inverted.
 
bool SteerMotorInverted = false
 True if the steer motor is inverted from the azimuth.
 
bool EncoderInverted = false
 True if the azimuth encoder is inverted from the azimuth.
 
units::dimensionless::scalar_t DriveMotorGearRatio = 0
 Gear ratio between the drive motor and the wheel.
 
units::dimensionless::scalar_t SteerMotorGearRatio = 0
 Gear ratio between the steer motor and the azimuth encoder.
 
units::dimensionless::scalar_t CouplingGearRatio = 0
 Coupled gear ratio between the azimuth encoder and the drive motor.
 
units::length::meter_t WheelRadius = 0_m
 Radius of the driving wheel in meters.
 
configs::Slot0Configs SteerMotorGains = configs::Slot0Configs{}
 The steer motor closed-loop gains.
 
configs::Slot0Configs DriveMotorGains = configs::Slot0Configs{}
 The drive motor closed-loop gains.
 
ClosedLoopOutputType SteerMotorClosedLoopOutput = ClosedLoopOutputType::Voltage
 The closed-loop output type to use for the steer motors.
 
ClosedLoopOutputType DriveMotorClosedLoopOutput = ClosedLoopOutputType::Voltage
 The closed-loop output type to use for the drive motors.
 
units::current::ampere_t SlipCurrent = 120_A
 The maximum amount of stator current the drive motors can apply without slippage.
 
units::velocity::meters_per_second_t SpeedAt12Volts = 0_mps
 When using open-loop drive control, this specifies the speed at which the robot travels when driven with 12 volts.
 
DriveMotorArrangement DriveMotorType = DriveMotorArrangement::TalonFX_Integrated
 Choose the motor used for the drive motor.
 
SteerMotorArrangement SteerMotorType = SteerMotorArrangement::TalonFX_Integrated
 Choose the motor used for the steer motor.
 
SteerFeedbackType FeedbackSource = SteerFeedbackType::FusedCANcoder
 Choose how the feedback sensors should be configured.
 
DriveMotorConfigsT DriveMotorInitialConfigs = {}
 The initial configs used to configure the drive motor of the swerve module.
 
SteerMotorConfigsT SteerMotorInitialConfigs = {}
 The initial configs used to configure the steer motor of the swerve module.
 
EncoderConfigsT EncoderInitialConfigs = {}
 The initial configs used to configure the azimuth encoder of the swerve module.
 
units::moment_of_inertia::kilogram_square_meter_t SteerInertia = 0.00001_kg_sq_m
 Simulated azimuthal inertia.
 
units::moment_of_inertia::kilogram_square_meter_t DriveInertia = 0.001_kg_sq_m
 Simulated drive inertia.
 
units::voltage::volt_t SteerFrictionVoltage = 0.25_V
 Simulated steer voltage required to overcome friction.
 
units::voltage::volt_t DriveFrictionVoltage = 0.25_V
 Simulated drive voltage required to overcome friction.
 

Detailed Description

template<typename DriveMotorConfigsT, typename SteerMotorConfigsT, typename EncoderConfigsT, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
struct ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >

All constants for a swerve module.

Constructor & Destructor Documentation

◆ SwerveModuleConstants()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SwerveModuleConstants ( )
constexprdefault

Member Function Documentation

◆ WithCouplingGearRatio()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithCouplingGearRatio ( units::dimensionless::scalar_t newCouplingGearRatio)
inlineconstexpr

Modifies the CouplingGearRatio parameter and returns itself.

Coupled gear ratio between the azimuth encoder and the drive motor.

For a typical swerve module, the azimuth turn motor also drives the wheel a nontrivial amount, which affects the accuracy of odometry and control. This ratio represents the number of rotations of the drive motor caused by a rotation of the azimuth.

Parameters
newCouplingGearRatioParameter to modify
Returns
this object

◆ WithDriveFrictionVoltage()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveFrictionVoltage ( units::voltage::volt_t newDriveFrictionVoltage)
inlineconstexpr

Modifies the DriveFrictionVoltage parameter and returns itself.

Simulated drive voltage required to overcome friction.

Parameters
newDriveFrictionVoltageParameter to modify
Returns
this object

◆ WithDriveInertia()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveInertia ( units::moment_of_inertia::kilogram_square_meter_t newDriveInertia)
inlineconstexpr

Modifies the DriveInertia parameter and returns itself.

Simulated drive inertia.

Parameters
newDriveInertiaParameter to modify
Returns
this object

◆ WithDriveMotorClosedLoopOutput()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorClosedLoopOutput ( ClosedLoopOutputType newDriveMotorClosedLoopOutput)
inlineconstexpr

Modifies the DriveMotorClosedLoopOutput parameter and returns itself.

The closed-loop output type to use for the drive motors.

Parameters
newDriveMotorClosedLoopOutputParameter to modify
Returns
this object

◆ WithDriveMotorGains()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorGains ( const configs::Slot0Configs & newDriveMotorGains)
inlineconstexpr

Modifies the DriveMotorGains parameter and returns itself.

The drive motor closed-loop gains.

When using closed-loop control, the drive motor uses the control output type specified by DriveMotorClosedLoopOutput and any closed-loop SwerveModule#DriveRequestType. These gains operate on motor rotor rotations (before the gear ratio).

Parameters
newDriveMotorGainsParameter to modify
Returns
this object

◆ WithDriveMotorGearRatio()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorGearRatio ( units::dimensionless::scalar_t newDriveMotorGearRatio)
inlineconstexpr

Modifies the DriveMotorGearRatio parameter and returns itself.

Gear ratio between the drive motor and the wheel.

Parameters
newDriveMotorGearRatioParameter to modify
Returns
this object

◆ WithDriveMotorId()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorId ( int newDriveMotorId)
inlineconstexpr

Modifies the DriveMotorId parameter and returns itself.

CAN ID of the drive motor.

Parameters
newDriveMotorIdParameter to modify
Returns
this object

◆ WithDriveMotorInitialConfigs()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorInitialConfigs ( const DriveMotorConfigsT & newDriveMotorInitialConfigs)
inlineconstexpr

Modifies the DriveMotorInitialConfigs parameter and returns itself.

The initial configs used to configure the drive motor of the swerve module. The default value is the factory-default.

Users may change the initial configuration as they need. Any config that's not referenced in the SwerveModuleConstants class is available to be changed.

The list of configs that will be overwritten is as follows:

Parameters
newDriveMotorInitialConfigsParameter to modify
Returns
this object

◆ WithDriveMotorInverted()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorInverted ( bool newDriveMotorInverted)
inlineconstexpr

Modifies the DriveMotorInverted parameter and returns itself.

True if the drive motor is inverted.

Parameters
newDriveMotorInvertedParameter to modify
Returns
this object

◆ WithDriveMotorType()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithDriveMotorType ( DriveMotorArrangement newDriveMotorType)
inlineconstexpr

Modifies the DriveMotorType parameter and returns itself.

Choose the motor used for the drive motor.

If using a Talon FX, this should be set to TalonFX_Integrated. If using a Talon FXS, this should be set to the motor attached to the Talon FXS.

Parameters
newDriveMotorTypeParameter to modify
Returns
this object

◆ WithEncoderId()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithEncoderId ( int newEncoderId)
inlineconstexpr

Modifies the EncoderId parameter and returns itself.

CAN ID of the absolute encoder used for azimuth.

Parameters
newEncoderIdParameter to modify
Returns
this object

◆ WithEncoderInitialConfigs()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithEncoderInitialConfigs ( const EncoderConfigsT & newEncoderInitialConfigs)
inlineconstexpr

Modifies the EncoderInitialConfigs parameter and returns itself.

The initial configs used to configure the azimuth encoder of the swerve module. The default value is the factory-default.

Users may change the initial configuration as they need. Any config that's not referenced in the SwerveModuleConstants class is available to be changed.

For CANcoder, the list of configs that will be overwritten is as follows:

Parameters
newEncoderInitialConfigsParameter to modify
Returns
this object

◆ WithEncoderInverted()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithEncoderInverted ( bool newEncoderInverted)
inlineconstexpr

Modifies the EncoderInverted parameter and returns itself.

True if the azimuth encoder is inverted from the azimuth. The encoder should report a positive velocity when the azimuth rotates counter-clockwise (as seen from the top of the robot).

Parameters
newEncoderInvertedParameter to modify
Returns
this object

◆ WithEncoderOffset()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithEncoderOffset ( units::angle::turn_t newEncoderOffset)
inlineconstexpr

Modifies the EncoderOffset parameter and returns itself.

Offset of the azimuth encoder.

Parameters
newEncoderOffsetParameter to modify
Returns
this object

◆ WithFeedbackSource()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithFeedbackSource ( SteerFeedbackType newFeedbackSource)
inlineconstexpr

Modifies the FeedbackSource parameter and returns itself.

Choose how the feedback sensors should be configured.

If the robot does not support Pro, then this should be set to RemoteCANcoder. Otherwise, users have the option to use either FusedCANcoder or SyncCANcoder depending on if there is a risk that the CANcoder can fail in a way to provide "good" data.

If this is set to FusedCANcoder or SyncCANcoder when the steer motor is not Pro-licensed, the device will automatically fall back to RemoteCANcoder and report a UsingProFeatureOnUnlicensedDevice status code.

Parameters
newFeedbackSourceParameter to modify
Returns
this object

◆ WithLocationX()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithLocationX ( units::length::meter_t newLocationX)
inlineconstexpr

Modifies the LocationX parameter and returns itself.

The location of this module's wheels relative to the physical center of the robot in meters along the X axis of the robot.

Parameters
newLocationXParameter to modify
Returns
this object

◆ WithLocationY()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithLocationY ( units::length::meter_t newLocationY)
inlineconstexpr

Modifies the LocationY parameter and returns itself.

The location of this module's wheels relative to the physical center of the robot in meters along the Y axis of the robot.

Parameters
newLocationYParameter to modify
Returns
this object

◆ WithSlipCurrent()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSlipCurrent ( units::current::ampere_t newSlipCurrent)
inlineconstexpr

Modifies the SlipCurrent parameter and returns itself.

The maximum amount of stator current the drive motors can apply without slippage.

Parameters
newSlipCurrentParameter to modify
Returns
this object

◆ WithSpeedAt12Volts()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSpeedAt12Volts ( units::velocity::meters_per_second_t newSpeedAt12Volts)
inlineconstexpr

Modifies the SpeedAt12Volts parameter and returns itself.

When using open-loop drive control, this specifies the speed at which the robot travels when driven with 12 volts. This is used to approximate the output for a desired velocity. If using closed loop control, this value is ignored.

Parameters
newSpeedAt12VoltsParameter to modify
Returns
this object

◆ WithSteerFrictionVoltage()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerFrictionVoltage ( units::voltage::volt_t newSteerFrictionVoltage)
inlineconstexpr

Modifies the SteerFrictionVoltage parameter and returns itself.

Simulated steer voltage required to overcome friction.

Parameters
newSteerFrictionVoltageParameter to modify
Returns
this object

◆ WithSteerInertia()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerInertia ( units::moment_of_inertia::kilogram_square_meter_t newSteerInertia)
inlineconstexpr

Modifies the SteerInertia parameter and returns itself.

Simulated azimuthal inertia.

Parameters
newSteerInertiaParameter to modify
Returns
this object

◆ WithSteerMotorClosedLoopOutput()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorClosedLoopOutput ( ClosedLoopOutputType newSteerMotorClosedLoopOutput)
inlineconstexpr

Modifies the SteerMotorClosedLoopOutput parameter and returns itself.

The closed-loop output type to use for the steer motors.

Parameters
newSteerMotorClosedLoopOutputParameter to modify
Returns
this object

◆ WithSteerMotorGains()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorGains ( const configs::Slot0Configs & newSteerMotorGains)
inlineconstexpr

Modifies the SteerMotorGains parameter and returns itself.

The steer motor closed-loop gains.

The steer motor uses the control ouput type specified by SteerMotorClosedLoopOutput and any SwerveModule#SteerRequestType. These gains operate on azimuth rotations (after the gear ratio).

Parameters
newSteerMotorGainsParameter to modify
Returns
this object

◆ WithSteerMotorGearRatio()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorGearRatio ( units::dimensionless::scalar_t newSteerMotorGearRatio)
inlineconstexpr

Modifies the SteerMotorGearRatio parameter and returns itself.

Gear ratio between the steer motor and the azimuth encoder. For example, the SDS Mk4 has a steering ratio of 12.8.

Parameters
newSteerMotorGearRatioParameter to modify
Returns
this object

◆ WithSteerMotorId()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorId ( int newSteerMotorId)
inlineconstexpr

Modifies the SteerMotorId parameter and returns itself.

CAN ID of the steer motor.

Parameters
newSteerMotorIdParameter to modify
Returns
this object

◆ WithSteerMotorInitialConfigs()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorInitialConfigs ( const SteerMotorConfigsT & newSteerMotorInitialConfigs)
inlineconstexpr

Modifies the SteerMotorInitialConfigs parameter and returns itself.

The initial configs used to configure the steer motor of the swerve module. The default value is the factory-default.

Users may change the initial configuration as they need. Any config that's not referenced in the SwerveModuleConstants class is available to be changed.

The list of configs that will be overwritten is as follows:

Parameters
newSteerMotorInitialConfigsParameter to modify
Returns
this object

◆ WithSteerMotorInverted()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorInverted ( bool newSteerMotorInverted)
inlineconstexpr

Modifies the SteerMotorInverted parameter and returns itself.

True if the steer motor is inverted from the azimuth. The azimuth should rotate counter-clockwise (as seen from the top of the robot) for a positive motor output.

Parameters
newSteerMotorInvertedParameter to modify
Returns
this object

◆ WithSteerMotorType()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithSteerMotorType ( SteerMotorArrangement newSteerMotorType)
inlineconstexpr

Modifies the SteerMotorType parameter and returns itself.

Choose the motor used for the steer motor.

If using a Talon FX, this should be set to TalonFX_Integrated. If using a Talon FXS, this should be set to the motor attached to the Talon FXS.

Parameters
newSteerMotorTypeParameter to modify
Returns
this object

◆ WithWheelRadius()

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WithWheelRadius ( units::length::meter_t newWheelRadius)
inlineconstexpr

Modifies the WheelRadius parameter and returns itself.

Radius of the driving wheel in meters.

Parameters
newWheelRadiusParameter to modify
Returns
this object

Member Data Documentation

◆ CouplingGearRatio

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::dimensionless::scalar_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::CouplingGearRatio = 0

Coupled gear ratio between the azimuth encoder and the drive motor.

For a typical swerve module, the azimuth turn motor also drives the wheel a nontrivial amount, which affects the accuracy of odometry and control. This ratio represents the number of rotations of the drive motor caused by a rotation of the azimuth.

◆ DriveFrictionVoltage

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::voltage::volt_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveFrictionVoltage = 0.25_V

Simulated drive voltage required to overcome friction.

◆ DriveInertia

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::moment_of_inertia::kilogram_square_meter_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveInertia = 0.001_kg_sq_m

Simulated drive inertia.

◆ DriveMotorClosedLoopOutput

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
ClosedLoopOutputType ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorClosedLoopOutput = ClosedLoopOutputType::Voltage

The closed-loop output type to use for the drive motors.

◆ DriveMotorGains

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
configs::Slot0Configs ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorGains = configs::Slot0Configs{}

The drive motor closed-loop gains.

When using closed-loop control, the drive motor uses the control output type specified by DriveMotorClosedLoopOutput and any closed-loop SwerveModule#DriveRequestType. These gains operate on motor rotor rotations (before the gear ratio).

◆ DriveMotorGearRatio

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::dimensionless::scalar_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorGearRatio = 0

Gear ratio between the drive motor and the wheel.

◆ DriveMotorId

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
int ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorId = 0

CAN ID of the drive motor.

◆ DriveMotorInitialConfigs

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
DriveMotorConfigsT ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorInitialConfigs = {}

The initial configs used to configure the drive motor of the swerve module.

The default value is the factory-default.

Users may change the initial configuration as they need. Any config that's not referenced in the SwerveModuleConstants class is available to be changed.

The list of configs that will be overwritten is as follows:

◆ DriveMotorInverted

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
bool ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorInverted = false

True if the drive motor is inverted.

◆ DriveMotorType

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
DriveMotorArrangement ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::DriveMotorType = DriveMotorArrangement::TalonFX_Integrated

Choose the motor used for the drive motor.

If using a Talon FX, this should be set to TalonFX_Integrated. If using a Talon FXS, this should be set to the motor attached to the Talon FXS.

◆ EncoderId

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
int ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::EncoderId = 0

CAN ID of the absolute encoder used for azimuth.

◆ EncoderInitialConfigs

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
EncoderConfigsT ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::EncoderInitialConfigs = {}

The initial configs used to configure the azimuth encoder of the swerve module.

The default value is the factory-default.

Users may change the initial configuration as they need. Any config that's not referenced in the SwerveModuleConstants class is available to be changed.

For CANcoder, the list of configs that will be overwritten is as follows:

◆ EncoderInverted

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
bool ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::EncoderInverted = false

True if the azimuth encoder is inverted from the azimuth.

The encoder should report a positive velocity when the azimuth rotates counter-clockwise (as seen from the top of the robot).

◆ EncoderOffset

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::angle::turn_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::EncoderOffset = 0_tr

Offset of the azimuth encoder.

◆ FeedbackSource

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SteerFeedbackType ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::FeedbackSource = SteerFeedbackType::FusedCANcoder

Choose how the feedback sensors should be configured.

If the robot does not support Pro, then this should be set to RemoteCANcoder. Otherwise, users have the option to use either FusedCANcoder or SyncCANcoder depending on if there is a risk that the CANcoder can fail in a way to provide "good" data.

If this is set to FusedCANcoder or SyncCANcoder when the steer motor is not Pro-licensed, the device will automatically fall back to RemoteCANcoder and report a UsingProFeatureOnUnlicensedDevice status code.

◆ LocationX

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::length::meter_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::LocationX = 0_m

The location of this module's wheels relative to the physical center of the robot in meters along the X axis of the robot.

◆ LocationY

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::length::meter_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::LocationY = 0_m

The location of this module's wheels relative to the physical center of the robot in meters along the Y axis of the robot.

◆ SlipCurrent

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::current::ampere_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SlipCurrent = 120_A

The maximum amount of stator current the drive motors can apply without slippage.

◆ SpeedAt12Volts

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::velocity::meters_per_second_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SpeedAt12Volts = 0_mps

When using open-loop drive control, this specifies the speed at which the robot travels when driven with 12 volts.

This is used to approximate the output for a desired velocity. If using closed loop control, this value is ignored.

◆ SteerFrictionVoltage

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::voltage::volt_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerFrictionVoltage = 0.25_V

Simulated steer voltage required to overcome friction.

◆ SteerInertia

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::moment_of_inertia::kilogram_square_meter_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerInertia = 0.00001_kg_sq_m

Simulated azimuthal inertia.

◆ SteerMotorClosedLoopOutput

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
ClosedLoopOutputType ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorClosedLoopOutput = ClosedLoopOutputType::Voltage

The closed-loop output type to use for the steer motors.

◆ SteerMotorGains

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
configs::Slot0Configs ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorGains = configs::Slot0Configs{}

The steer motor closed-loop gains.

The steer motor uses the control ouput type specified by SteerMotorClosedLoopOutput and any SwerveModule#SteerRequestType. These gains operate on azimuth rotations (after the gear ratio).

◆ SteerMotorGearRatio

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::dimensionless::scalar_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorGearRatio = 0

Gear ratio between the steer motor and the azimuth encoder.

For example, the SDS Mk4 has a steering ratio of 12.8.

◆ SteerMotorId

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
int ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorId = 0

CAN ID of the steer motor.

◆ SteerMotorInitialConfigs

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SteerMotorConfigsT ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorInitialConfigs = {}

◆ SteerMotorInverted

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
bool ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorInverted = false

True if the steer motor is inverted from the azimuth.

The azimuth should rotate counter-clockwise (as seen from the top of the robot) for a positive motor output.

◆ SteerMotorType

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
SteerMotorArrangement ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::SteerMotorType = SteerMotorArrangement::TalonFX_Integrated

Choose the motor used for the steer motor.

If using a Talon FX, this should be set to TalonFX_Integrated. If using a Talon FXS, this should be set to the motor attached to the Talon FXS.

◆ WheelRadius

template<typename DriveMotorConfigsT , typename SteerMotorConfigsT , typename EncoderConfigsT , typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>, typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>>
units::length::meter_t ctre::phoenix6::swerve::SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT, typename, typename, typename >::WheelRadius = 0_m

Radius of the driving wheel in meters.


The documentation for this struct was generated from the following file: