CTRE Phoenix 6 C++ 24.50.0-alpha-2
ctre::phoenix6::swerve::impl::SwerveModuleState Struct Reference

#include <ctre/phoenix6/swerve/impl/SwerveDriveKinematics.hpp>

Public Member Functions

bool operator== (SwerveModuleState const &other) const
 
bool operator!= (SwerveModuleState const &other) const
 

Static Public Member Functions

static SwerveModuleState Optimize (SwerveModuleState const &desiredState, Rotation2d currentAngle)
 Minimize the change in heading the desired swerve module state would require by potentially reversing the direction the wheel spins. More...
 

Public Attributes

units::meters_per_second_t speed = 0_mps
 Speed of the wheel of the module. More...
 
Rotation2d angle = 0_rad
 Angle of the module. More...
 

Member Function Documentation

◆ operator!=()

bool ctre::phoenix6::swerve::impl::SwerveModuleState::operator!= ( SwerveModuleState const &  other) const
inline

◆ operator==()

bool ctre::phoenix6::swerve::impl::SwerveModuleState::operator== ( SwerveModuleState const &  other) const
inline

◆ Optimize()

static SwerveModuleState ctre::phoenix6::swerve::impl::SwerveModuleState::Optimize ( SwerveModuleState const &  desiredState,
Rotation2d  currentAngle 
)
inlinestatic

Minimize the change in heading the desired swerve module state would require by potentially reversing the direction the wheel spins.

If this is used with the PIDController class's continuous input functionality, the furthest a wheel will ever rotate is 90 degrees.

Parameters
desiredStateThe desired state.
currentAngleThe current module angle.

Member Data Documentation

◆ angle

Rotation2d ctre::phoenix6::swerve::impl::SwerveModuleState::angle = 0_rad

Angle of the module.

◆ speed

units::meters_per_second_t ctre::phoenix6::swerve::impl::SwerveModuleState::speed = 0_mps

Speed of the wheel of the module.


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