Class TunerSwerveDrivetrain
ClassList > TunerSwerveDrivetrain
Swerve Drive class utilizing CTR Electronics' Phoenix 6 API with the selected device types.
#include <TunerConstants.h>
Inherits the following classes: swerve::SwerveDrivetrain< hardware::TalonFX, hardware::TalonFX, hardware::CANcoder >
Inherited by the following classes: subsystems::CommandSwerveDrivetrain
Public Types
Type | Name |
---|---|
typedef swerve::SwerveModuleConstants< configs::TalonFXConfiguration, configs::TalonFXConfiguration, configs::CANcoderConfiguration > | SwerveModuleConstants |
Public Functions
Type | Name |
---|---|
TunerSwerveDrivetrain (swerve::SwerveDrivetrainConstants const & driveTrainConstants, ModuleConstants const &... modules) Constructs a CTRE SwerveDrivetrain using the specified constants. |
|
TunerSwerveDrivetrain (swerve::SwerveDrivetrainConstants const & driveTrainConstants, units::hertz_t odometryUpdateFrequency, ModuleConstants const &... modules) Constructs a CTRE SwerveDrivetrain using the specified constants. |
|
TunerSwerveDrivetrain (swerve::SwerveDrivetrainConstants const & driveTrainConstants, units::hertz_t odometryUpdateFrequency, std::array< double, 3 > const & odometryStandardDeviation, std::array< double, 3 > const & visionStandardDeviation, ModuleConstants const &... modules) Constructs a CTRE SwerveDrivetrain using the specified constants. |
Public Types Documentation
typedef SwerveModuleConstants
using TunerSwerveDrivetrain::SwerveModuleConstants = swerve::SwerveModuleConstants<configs::TalonFXConfiguration, configs::TalonFXConfiguration, configs::CANcoderConfiguration>;
Public Functions Documentation
function TunerSwerveDrivetrain [1/3]
Constructs a CTRE SwerveDrivetrain using the specified constants.
template<std::same_as< SwerveModuleConstants >... ModuleConstants>
inline TunerSwerveDrivetrain::TunerSwerveDrivetrain (
swerve::SwerveDrivetrainConstants const & driveTrainConstants,
ModuleConstants const &... modules
)
This constructs the underlying hardware devices, so users should not construct the devices themselves. If they need the devices, they can access them through getters in the classes.
Parameters:
drivetrainConstants
Drivetrain-wide constants for the swerve drivemodules
Constants for each specific module
function TunerSwerveDrivetrain [2/3]
Constructs a CTRE SwerveDrivetrain using the specified constants.
template<std::same_as< SwerveModuleConstants >... ModuleConstants>
inline TunerSwerveDrivetrain::TunerSwerveDrivetrain (
swerve::SwerveDrivetrainConstants const & driveTrainConstants,
units::hertz_t odometryUpdateFrequency,
ModuleConstants const &... modules
)
This constructs the underlying hardware devices, so users should not construct the devices themselves. If they need the devices, they can access them through getters in the classes.
Parameters:
drivetrainConstants
Drivetrain-wide constants for the swerve driveodometryUpdateFrequency
The frequency to run the odometry loop. If unspecified or set to 0 Hz, this is 250 Hz on CAN FD, and 100 Hz on CAN 2.0.modules
Constants for each specific module
function TunerSwerveDrivetrain [3/3]
Constructs a CTRE SwerveDrivetrain using the specified constants.
template<std::same_as< SwerveModuleConstants >... ModuleConstants>
inline TunerSwerveDrivetrain::TunerSwerveDrivetrain (
swerve::SwerveDrivetrainConstants const & driveTrainConstants,
units::hertz_t odometryUpdateFrequency,
std::array< double, 3 > const & odometryStandardDeviation,
std::array< double, 3 > const & visionStandardDeviation,
ModuleConstants const &... modules
)
This constructs the underlying hardware devices, so users should not construct the devices themselves. If they need the devices, they can access them through getters in the classes.
Parameters:
drivetrainConstants
Drivetrain-wide constants for the swerve driveodometryUpdateFrequency
The frequency to run the odometry loop. If unspecified or set to 0 Hz, this is 250 Hz on CAN FD, and 100 Hz on CAN 2.0.odometryStandardDeviation
The standard deviation for odometry calculation in the form [x, y, theta]ᵀ, with units in meters and radiansvisionStandardDeviation
The standard deviation for vision calculation in the form [x, y, theta]ᵀ, with units in meters and radiansmodules
Constants for each specific module
The documentation for this class was generated from the following file src/main/include/generated/TunerConstants.h