Represents the velocity of one swerve module.
More...
#include <wpi/math/kinematics/SwerveModuleVelocity.hpp>
|
| 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.
◆ CosineScale()
| void wpi::math::SwerveModuleVelocity::CosineScale |
( |
const Rotation2d & | currentAngle | ) |
|
|
inlineconstexpr |
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.
- Parameters
-
| currentAngle | The current module angle. |
◆ operator==()
Checks equality between this SwerveModuleVelocity and another object.
- Parameters
-
- Returns
- Whether the two objects are equal.
◆ Optimize() [1/2]
| void wpi::math::SwerveModuleVelocity::Optimize |
( |
const Rotation2d & | currentAngle | ) |
|
|
inlineconstexpr |
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.
- Parameters
-
| currentAngle | The current module angle. |
◆ Optimize() [2/2]
Minimize the change in heading the desired 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.
- Parameters
-
| desiredVelocity | The desired velocity. |
| currentAngle | The current module angle. |
◆ angle
◆ velocity
| wpi::units::meters_per_second_t wpi::math::SwerveModuleVelocity::velocity = 0_mps |
Velocity of the wheel of the module.
The documentation for this struct was generated from the following file: