![]() |
WPILibC++ 2027.0.0-alpha-5
|
Represents the velocity of one swerve module. More...
#include <wpi/math/kinematics/SwerveModuleVelocity.hpp>
Public Member Functions | |
| constexpr bool | operator== (const SwerveModuleVelocity &other) const |
| Checks equality between this SwerveModuleVelocity and another object. | |
| constexpr SwerveModuleVelocity | Optimize (const Rotation2d ¤tAngle) |
| Minimize the change in the heading this swerve module velocity would require by potentially reversing the direction the wheel spins. | |
| constexpr SwerveModuleVelocity | CosineScale (const Rotation2d ¤tAngle) |
| Scales velocity by cosine of angle error. | |
Public Attributes | |
| wpi::units::meters_per_second_t | velocity = 0_mps |
| Velocity of the wheel of the module. | |
| Rotation2d | angle |
| Angle of the module. | |
Represents the velocity of one swerve module.
|
inlinenodiscardconstexpr |
Scales velocity by cosine of angle error.
This scales down movement perpendicular to the desired direction of travel that can occur when modules change directions. This results in smoother driving.
| currentAngle | The current module angle. |
|
inlineconstexpr |
Checks equality between this SwerveModuleVelocity and another object.
| other | The other object. |
|
inlinenodiscardconstexpr |
Minimize the change in the heading this swerve module velocity 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.
| currentAngle | The current module angle. |
| Rotation2d wpi::math::SwerveModuleVelocity::angle |
Angle of the module.
| wpi::units::meters_per_second_t wpi::math::SwerveModuleVelocity::velocity = 0_mps |
Velocity of the wheel of the module.