12#include <units/length.h>
13#include <units/moment_of_inertia.h>
14#include <units/velocity.h>
110 typename DriveMotorConfigsT,
111 typename SteerMotorConfigsT,
112 typename EncoderConfigsT,
113 typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>,
114 typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>,
115 typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>
314 units::moment_of_inertia::kilogram_square_meter_t
SteerInertia = 0.00001_kg_sq_m;
318 units::moment_of_inertia::kilogram_square_meter_t
DriveInertia = 0.001_kg_sq_m;
338 this->SteerMotorId = newSteerMotorId;
352 this->DriveMotorId = newDriveMotorId;
366 this->EncoderId = newEncoderId;
380 this->EncoderOffset = newEncoderOffset;
395 this->LocationX = newLocationX;
410 this->LocationY = newLocationY;
424 this->DriveMotorInverted = newDriveMotorInverted;
440 this->SteerMotorInverted = newSteerMotorInverted;
456 this->EncoderInverted = newEncoderInverted;
470 this->DriveMotorGearRatio = newDriveMotorGearRatio;
485 this->SteerMotorGearRatio = newSteerMotorGearRatio;
504 this->CouplingGearRatio = newCouplingGearRatio;
518 this->WheelRadius = newWheelRadius;
536 this->SteerMotorGains = newSteerMotorGains;
555 this->DriveMotorGains = newDriveMotorGains;
569 this->SteerMotorClosedLoopOutput = newSteerMotorClosedLoopOutput;
583 this->DriveMotorClosedLoopOutput = newDriveMotorClosedLoopOutput;
598 this->SlipCurrent = newSlipCurrent;
615 this->SpeedAt12Volts = newSpeedAt12Volts;
632 this->DriveMotorType = newDriveMotorType;
649 this->SteerMotorType = newSteerMotorType;
672 this->FeedbackSource = newFeedbackSource;
704 this->DriveMotorInitialConfigs = newDriveMotorInitialConfigs;
739 this->SteerMotorInitialConfigs = newSteerMotorInitialConfigs;
765 this->EncoderInitialConfigs = newEncoderInitialConfigs;
779 this->SteerInertia = newSteerInertia;
793 this->DriveInertia = newDriveInertia;
807 this->SteerFrictionVoltage = newSteerFrictionVoltage;
821 this->DriveFrictionVoltage = newDriveFrictionVoltage;
832 typename DriveMotorConfigsT,
833 typename SteerMotorConfigsT,
834 typename EncoderConfigsT,
835 typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, DriveMotorConfigsT>>,
836 typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, SteerMotorConfigsT>>,
837 typename = std::enable_if_t<std::is_base_of_v<configs::ParentConfiguration, EncoderConfigsT>>
994 units::moment_of_inertia::kilogram_square_meter_t
SteerInertia = 0.00001_kg_sq_m;
998 units::moment_of_inertia::kilogram_square_meter_t
DriveInertia = 0.001_kg_sq_m;
1018 this->DriveMotorGearRatio = newDriveMotorGearRatio;
1033 this->SteerMotorGearRatio = newSteerMotorGearRatio;
1052 this->CouplingGearRatio = newCouplingGearRatio;
1066 this->WheelRadius = newWheelRadius;
1084 this->SteerMotorGains = newSteerMotorGains;
1103 this->DriveMotorGains = newDriveMotorGains;
1117 this->SteerMotorClosedLoopOutput = newSteerMotorClosedLoopOutput;
1131 this->DriveMotorClosedLoopOutput = newDriveMotorClosedLoopOutput;
1146 this->SlipCurrent = newSlipCurrent;
1163 this->SpeedAt12Volts = newSpeedAt12Volts;
1180 this->DriveMotorType = newDriveMotorType;
1197 this->SteerMotorType = newSteerMotorType;
1220 this->FeedbackSource = newFeedbackSource;
1252 this->DriveMotorInitialConfigs = newDriveMotorInitialConfigs;
1287 this->SteerMotorInitialConfigs = newSteerMotorInitialConfigs;
1313 this->EncoderInitialConfigs = newEncoderInitialConfigs;
1327 this->SteerInertia = newSteerInertia;
1341 this->DriveInertia = newDriveInertia;
1355 this->SteerFrictionVoltage = newSteerFrictionVoltage;
1369 this->DriveFrictionVoltage = newDriveFrictionVoltage;
1391 units::angle::turn_t encoderOffset,
1392 units::length::meter_t locationX,
1393 units::length::meter_t locationY,
1394 bool driveMotorInverted,
1395 bool steerMotorInverted,
1396 bool encoderInverted)
const
1400 .WithDriveMotorId(driveMotorId)
1401 .WithEncoderId(encoderId)
1402 .WithEncoderOffset(encoderOffset)
1403 .WithLocationX(locationX)
1404 .WithLocationY(locationY)
1405 .WithDriveMotorInverted(driveMotorInverted)
1406 .WithSteerMotorInverted(steerMotorInverted)
1407 .WithEncoderInverted(encoderInverted)
Gains for the specified slot.
Definition Configs.hpp:4279
ClosedLoopOutputType
Supported closed-loop output types.
Definition SwerveModuleConstants.hpp:23
@ TorqueCurrentFOC
Requires Pro.
SteerMotorArrangement
Supported motor arrangements for the steer motors.
Definition SwerveModuleConstants.hpp:50
@ TalonFXS_Brushed_AC
Brushed motor connected to a Talon FXS on terminals A and C.
@ TalonFXS_Brushed_AB
Brushed motor connected to a Talon FXS on terminals A and B.
@ TalonFX_Integrated
Talon FX integrated brushless motor.
@ TalonFXS_Brushed_BC
Brushed motor connected to a Talon FXS on terminals B and C.
@ TalonFXS_NEO550_JST
Third party NEO550 brushless motor connected to a Talon FXS over JST.
@ TalonFXS_Minion_JST
CTR Electronics MinionĀ® brushless motor connected to a Talon FXS over JST.
SteerFeedbackType
Supported feedback sensors for the steer motors.
Definition SwerveModuleConstants.hpp:88
@ FusedCANcoder
Requires Pro; Use signals::FeedbackSensorSourceValue::FusedCANcoder for the steer motor.
@ SyncCANcoder
Requires Pro; Use signals::FeedbackSensorSourceValue::SyncCANcoder for the steer motor.
@ RemoteCANcoder
Use signals::FeedbackSensorSourceValue::RemoteCANcoder for the steer motor.
DriveMotorArrangement
Supported motor arrangements for the drive motors.
Definition SwerveModuleConstants.hpp:32
@ TalonFX_Integrated
Talon FX integrated brushless motor.
@ TalonFXS_NEO_JST
Third party NEO brushless motor connected to a Talon FXS over JST.
@ TalonFXS_VORTEX_JST
Third party VORTEX brushless motor connected to a Talon FXS over JST.
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18
Constants that are common across the swerve modules, used for creating instances of module-specific S...
Definition SwerveModuleConstants.hpp:839
SteerMotorArrangement SteerMotorType
Choose the motor used for the steer motor.
Definition SwerveModuleConstants.hpp:914
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerFrictionVoltage(units::voltage::volt_t newSteerFrictionVoltage)
Modifies the SteerFrictionVoltage parameter and returns itself.
Definition SwerveModuleConstants.hpp:1353
units::current::ampere_t SlipCurrent
The maximum amount of stator current the drive motors can apply without slippage.
Definition SwerveModuleConstants.hpp:893
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSpeedAt12Volts(units::velocity::meters_per_second_t newSpeedAt12Volts)
Modifies the SpeedAt12Volts parameter and returns itself.
Definition SwerveModuleConstants.hpp:1161
units::moment_of_inertia::kilogram_square_meter_t DriveInertia
Simulated drive inertia.
Definition SwerveModuleConstants.hpp:998
EncoderConfigsT EncoderInitialConfigs
The initial configs used to configure the azimuth encoder of the swerve module.
Definition SwerveModuleConstants.hpp:990
configs::Slot0Configs DriveMotorGains
The drive motor closed-loop gains.
Definition SwerveModuleConstants.hpp:880
units::velocity::meters_per_second_t SpeedAt12Volts
When using open-loop drive control, this specifies the speed at which the robot travels when driven w...
Definition SwerveModuleConstants.hpp:900
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveFrictionVoltage(units::voltage::volt_t newDriveFrictionVoltage)
Modifies the DriveFrictionVoltage parameter and returns itself.
Definition SwerveModuleConstants.hpp:1367
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithFeedbackSource(SteerFeedbackType newFeedbackSource)
Modifies the FeedbackSource parameter and returns itself.
Definition SwerveModuleConstants.hpp:1218
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorGearRatio(units::dimensionless::scalar_t newSteerMotorGearRatio)
Modifies the SteerMotorGearRatio parameter and returns itself.
Definition SwerveModuleConstants.hpp:1031
units::voltage::volt_t SteerFrictionVoltage
Simulated steer voltage required to overcome friction.
Definition SwerveModuleConstants.hpp:1002
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorInitialConfigs(DriveMotorConfigsT newDriveMotorInitialConfigs)
Modifies the DriveMotorInitialConfigs parameter and returns itself.
Definition SwerveModuleConstants.hpp:1250
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > CreateModuleConstants(int steerMotorId, int driveMotorId, int encoderId, units::angle::turn_t encoderOffset, units::length::meter_t locationX, units::length::meter_t locationY, bool driveMotorInverted, bool steerMotorInverted, bool encoderInverted) const
Creates the constants for a swerve module with the given properties.
Definition SwerveModuleConstants.hpp:1387
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorType(DriveMotorArrangement newDriveMotorType)
Modifies the DriveMotorType parameter and returns itself.
Definition SwerveModuleConstants.hpp:1178
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithCouplingGearRatio(units::dimensionless::scalar_t newCouplingGearRatio)
Modifies the CouplingGearRatio parameter and returns itself.
Definition SwerveModuleConstants.hpp:1050
units::dimensionless::scalar_t DriveMotorGearRatio
Gear ratio between the drive motor and the wheel.
Definition SwerveModuleConstants.hpp:845
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorClosedLoopOutput(ClosedLoopOutputType newSteerMotorClosedLoopOutput)
Modifies the SteerMotorClosedLoopOutput parameter and returns itself.
Definition SwerveModuleConstants.hpp:1115
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerInertia(units::moment_of_inertia::kilogram_square_meter_t newSteerInertia)
Modifies the SteerInertia parameter and returns itself.
Definition SwerveModuleConstants.hpp:1325
units::length::meter_t WheelRadius
Radius of the driving wheel in meters.
Definition SwerveModuleConstants.hpp:863
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorClosedLoopOutput(ClosedLoopOutputType newDriveMotorClosedLoopOutput)
Modifies the DriveMotorClosedLoopOutput parameter and returns itself.
Definition SwerveModuleConstants.hpp:1129
units::voltage::volt_t DriveFrictionVoltage
Simulated drive voltage required to overcome friction.
Definition SwerveModuleConstants.hpp:1006
DriveMotorArrangement DriveMotorType
Choose the motor used for the drive motor.
Definition SwerveModuleConstants.hpp:907
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveInertia(units::moment_of_inertia::kilogram_square_meter_t newDriveInertia)
Modifies the DriveInertia parameter and returns itself.
Definition SwerveModuleConstants.hpp:1339
units::dimensionless::scalar_t CouplingGearRatio
Coupled gear ratio between the azimuth encoder and the drive motor.
Definition SwerveModuleConstants.hpp:859
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorInitialConfigs(SteerMotorConfigsT newSteerMotorInitialConfigs)
Modifies the SteerMotorInitialConfigs parameter and returns itself.
Definition SwerveModuleConstants.hpp:1285
SteerMotorConfigsT SteerMotorInitialConfigs
The initial configs used to configure the steer motor of the swerve module.
Definition SwerveModuleConstants.hpp:974
ClosedLoopOutputType DriveMotorClosedLoopOutput
The closed-loop output type to use for the drive motors.
Definition SwerveModuleConstants.hpp:888
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithWheelRadius(units::length::meter_t newWheelRadius)
Modifies the WheelRadius parameter and returns itself.
Definition SwerveModuleConstants.hpp:1064
units::dimensionless::scalar_t SteerMotorGearRatio
Gear ratio between the steer motor and the azimuth encoder.
Definition SwerveModuleConstants.hpp:850
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorGains(configs::Slot0Configs newSteerMotorGains)
Modifies the SteerMotorGains parameter and returns itself.
Definition SwerveModuleConstants.hpp:1082
SteerFeedbackType FeedbackSource
Choose how the feedback sensors should be configured.
Definition SwerveModuleConstants.hpp:927
constexpr SwerveModuleConstantsFactory()=default
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorGearRatio(units::dimensionless::scalar_t newDriveMotorGearRatio)
Modifies the DriveMotorGearRatio parameter and returns itself.
Definition SwerveModuleConstants.hpp:1016
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSlipCurrent(units::current::ampere_t newSlipCurrent)
Modifies the SlipCurrent parameter and returns itself.
Definition SwerveModuleConstants.hpp:1144
units::moment_of_inertia::kilogram_square_meter_t SteerInertia
Simulated azimuthal inertia.
Definition SwerveModuleConstants.hpp:994
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorType(SteerMotorArrangement newSteerMotorType)
Modifies the SteerMotorType parameter and returns itself.
Definition SwerveModuleConstants.hpp:1195
configs::Slot0Configs SteerMotorGains
The steer motor closed-loop gains.
Definition SwerveModuleConstants.hpp:871
DriveMotorConfigsT DriveMotorInitialConfigs
The initial configs used to configure the drive motor of the swerve module.
Definition SwerveModuleConstants.hpp:949
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorGains(configs::Slot0Configs newDriveMotorGains)
Modifies the DriveMotorGains parameter and returns itself.
Definition SwerveModuleConstants.hpp:1101
ClosedLoopOutputType SteerMotorClosedLoopOutput
The closed-loop output type to use for the steer motors.
Definition SwerveModuleConstants.hpp:884
constexpr SwerveModuleConstantsFactory< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderInitialConfigs(EncoderConfigsT newEncoderInitialConfigs)
Modifies the EncoderInitialConfigs parameter and returns itself.
Definition SwerveModuleConstants.hpp:1311
All constants for a swerve module.
Definition SwerveModuleConstants.hpp:117
DriveMotorArrangement DriveMotorType
Choose the motor used for the drive motor.
Definition SwerveModuleConstants.hpp:227
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderInitialConfigs(const EncoderConfigsT &newEncoderInitialConfigs)
Modifies the EncoderInitialConfigs parameter and returns itself.
Definition SwerveModuleConstants.hpp:763
bool DriveMotorInverted
True if the drive motor is inverted.
Definition SwerveModuleConstants.hpp:149
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorGearRatio(units::dimensionless::scalar_t newSteerMotorGearRatio)
Modifies the SteerMotorGearRatio parameter and returns itself.
Definition SwerveModuleConstants.hpp:483
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithLocationX(units::length::meter_t newLocationX)
Modifies the LocationX parameter and returns itself.
Definition SwerveModuleConstants.hpp:393
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderOffset(units::angle::turn_t newEncoderOffset)
Modifies the EncoderOffset parameter and returns itself.
Definition SwerveModuleConstants.hpp:378
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderInverted(bool newEncoderInverted)
Modifies the EncoderInverted parameter and returns itself.
Definition SwerveModuleConstants.hpp:454
units::length::meter_t LocationY
The location of this module's wheels relative to the physical center of the robot in meters along the...
Definition SwerveModuleConstants.hpp:145
configs::Slot0Configs SteerMotorGains
The steer motor closed-loop gains.
Definition SwerveModuleConstants.hpp:191
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerFrictionVoltage(units::voltage::volt_t newSteerFrictionVoltage)
Modifies the SteerFrictionVoltage parameter and returns itself.
Definition SwerveModuleConstants.hpp:805
SteerFeedbackType FeedbackSource
Choose how the feedback sensors should be configured.
Definition SwerveModuleConstants.hpp:247
EncoderConfigsT EncoderInitialConfigs
The initial configs used to configure the azimuth encoder of the swerve module.
Definition SwerveModuleConstants.hpp:310
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorInitialConfigs(const DriveMotorConfigsT &newDriveMotorInitialConfigs)
Modifies the DriveMotorInitialConfigs parameter and returns itself.
Definition SwerveModuleConstants.hpp:702
units::angle::turn_t EncoderOffset
Offset of the azimuth encoder.
Definition SwerveModuleConstants.hpp:135
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithEncoderId(int newEncoderId)
Modifies the EncoderId parameter and returns itself.
Definition SwerveModuleConstants.hpp:364
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithFeedbackSource(SteerFeedbackType newFeedbackSource)
Modifies the FeedbackSource parameter and returns itself.
Definition SwerveModuleConstants.hpp:670
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorInverted(bool newSteerMotorInverted)
Modifies the SteerMotorInverted parameter and returns itself.
Definition SwerveModuleConstants.hpp:438
SteerMotorConfigsT SteerMotorInitialConfigs
The initial configs used to configure the steer motor of the swerve module.
Definition SwerveModuleConstants.hpp:294
units::moment_of_inertia::kilogram_square_meter_t SteerInertia
Simulated azimuthal inertia.
Definition SwerveModuleConstants.hpp:314
units::current::ampere_t SlipCurrent
The maximum amount of stator current the drive motors can apply without slippage.
Definition SwerveModuleConstants.hpp:213
int SteerMotorId
CAN ID of the steer motor.
Definition SwerveModuleConstants.hpp:123
units::length::meter_t LocationX
The location of this module's wheels relative to the physical center of the robot in meters along the...
Definition SwerveModuleConstants.hpp:140
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorType(DriveMotorArrangement newDriveMotorType)
Modifies the DriveMotorType parameter and returns itself.
Definition SwerveModuleConstants.hpp:630
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithCouplingGearRatio(units::dimensionless::scalar_t newCouplingGearRatio)
Modifies the CouplingGearRatio parameter and returns itself.
Definition SwerveModuleConstants.hpp:502
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorId(int newSteerMotorId)
Modifies the SteerMotorId parameter and returns itself.
Definition SwerveModuleConstants.hpp:336
units::velocity::meters_per_second_t SpeedAt12Volts
When using open-loop drive control, this specifies the speed at which the robot travels when driven w...
Definition SwerveModuleConstants.hpp:220
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorGains(const configs::Slot0Configs &newDriveMotorGains)
Modifies the DriveMotorGains parameter and returns itself.
Definition SwerveModuleConstants.hpp:553
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorGearRatio(units::dimensionless::scalar_t newDriveMotorGearRatio)
Modifies the DriveMotorGearRatio parameter and returns itself.
Definition SwerveModuleConstants.hpp:468
units::moment_of_inertia::kilogram_square_meter_t DriveInertia
Simulated drive inertia.
Definition SwerveModuleConstants.hpp:318
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorClosedLoopOutput(ClosedLoopOutputType newSteerMotorClosedLoopOutput)
Modifies the SteerMotorClosedLoopOutput parameter and returns itself.
Definition SwerveModuleConstants.hpp:567
units::voltage::volt_t SteerFrictionVoltage
Simulated steer voltage required to overcome friction.
Definition SwerveModuleConstants.hpp:322
ClosedLoopOutputType SteerMotorClosedLoopOutput
The closed-loop output type to use for the steer motors.
Definition SwerveModuleConstants.hpp:204
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerInertia(units::moment_of_inertia::kilogram_square_meter_t newSteerInertia)
Modifies the SteerInertia parameter and returns itself.
Definition SwerveModuleConstants.hpp:777
DriveMotorConfigsT DriveMotorInitialConfigs
The initial configs used to configure the drive motor of the swerve module.
Definition SwerveModuleConstants.hpp:269
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorId(int newDriveMotorId)
Modifies the DriveMotorId parameter and returns itself.
Definition SwerveModuleConstants.hpp:350
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorInverted(bool newDriveMotorInverted)
Modifies the DriveMotorInverted parameter and returns itself.
Definition SwerveModuleConstants.hpp:422
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithLocationY(units::length::meter_t newLocationY)
Modifies the LocationY parameter and returns itself.
Definition SwerveModuleConstants.hpp:408
units::voltage::volt_t DriveFrictionVoltage
Simulated drive voltage required to overcome friction.
Definition SwerveModuleConstants.hpp:326
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorGains(const configs::Slot0Configs &newSteerMotorGains)
Modifies the SteerMotorGains parameter and returns itself.
Definition SwerveModuleConstants.hpp:534
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorInitialConfigs(const SteerMotorConfigsT &newSteerMotorInitialConfigs)
Modifies the SteerMotorInitialConfigs parameter and returns itself.
Definition SwerveModuleConstants.hpp:737
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveInertia(units::moment_of_inertia::kilogram_square_meter_t newDriveInertia)
Modifies the DriveInertia parameter and returns itself.
Definition SwerveModuleConstants.hpp:791
bool EncoderInverted
True if the azimuth encoder is inverted from the azimuth.
Definition SwerveModuleConstants.hpp:161
int DriveMotorId
CAN ID of the drive motor.
Definition SwerveModuleConstants.hpp:127
units::dimensionless::scalar_t CouplingGearRatio
Coupled gear ratio between the azimuth encoder and the drive motor.
Definition SwerveModuleConstants.hpp:179
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveMotorClosedLoopOutput(ClosedLoopOutputType newDriveMotorClosedLoopOutput)
Modifies the DriveMotorClosedLoopOutput parameter and returns itself.
Definition SwerveModuleConstants.hpp:581
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSpeedAt12Volts(units::velocity::meters_per_second_t newSpeedAt12Volts)
Modifies the SpeedAt12Volts parameter and returns itself.
Definition SwerveModuleConstants.hpp:613
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithDriveFrictionVoltage(units::voltage::volt_t newDriveFrictionVoltage)
Modifies the DriveFrictionVoltage parameter and returns itself.
Definition SwerveModuleConstants.hpp:819
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSlipCurrent(units::current::ampere_t newSlipCurrent)
Modifies the SlipCurrent parameter and returns itself.
Definition SwerveModuleConstants.hpp:596
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithWheelRadius(units::length::meter_t newWheelRadius)
Modifies the WheelRadius parameter and returns itself.
Definition SwerveModuleConstants.hpp:516
bool SteerMotorInverted
True if the steer motor is inverted from the azimuth.
Definition SwerveModuleConstants.hpp:155
units::length::meter_t WheelRadius
Radius of the driving wheel in meters.
Definition SwerveModuleConstants.hpp:183
ClosedLoopOutputType DriveMotorClosedLoopOutput
The closed-loop output type to use for the drive motors.
Definition SwerveModuleConstants.hpp:208
units::dimensionless::scalar_t DriveMotorGearRatio
Gear ratio between the drive motor and the wheel.
Definition SwerveModuleConstants.hpp:165
constexpr SwerveModuleConstants()=default
int EncoderId
CAN ID of the absolute encoder used for azimuth.
Definition SwerveModuleConstants.hpp:131
constexpr SwerveModuleConstants< DriveMotorConfigsT, SteerMotorConfigsT, EncoderConfigsT > & WithSteerMotorType(SteerMotorArrangement newSteerMotorType)
Modifies the SteerMotorType parameter and returns itself.
Definition SwerveModuleConstants.hpp:647
units::dimensionless::scalar_t SteerMotorGearRatio
Gear ratio between the steer motor and the azimuth encoder.
Definition SwerveModuleConstants.hpp:170
SteerMotorArrangement SteerMotorType
Choose the motor used for the steer motor.
Definition SwerveModuleConstants.hpp:234
configs::Slot0Configs DriveMotorGains
The drive motor closed-loop gains.
Definition SwerveModuleConstants.hpp:200