Valkyrie 2026
Loading...
Searching...
No Matches
valor::swerve::requests::ApplyState Struct Reference

Request structure for commanding a single swerve module state. More...

#include <valkyrie/drivetrain/swerve/Requests.h>

Public Attributes

frc::SwerveModuleState state
 Desired state for the swerve module.
BaseController::Output zeroOutput = 0
 Default output value used when no controller output is provided.
BaseController::Output feedforward = 0
 Optional feedforward output for the swerve module.
OutputType outputType = OutputType::Velocity
 Output control mode used when applying drive requests.
bool optimize = true
 Whether to optimize the module state.
bool cosineScaling = true
units::meters_per_second_t deadband = 0_mps
 Minimum wheel speed required before motion is applied.

Detailed Description

Request structure for commanding a single swerve module state.

Contains the desired wheel speed and steering angle, along with configuration options for module optimization and speed deadbanding.

Member Data Documentation

◆ cosineScaling

bool valor::swerve::requests::ApplyState::cosineScaling = true

@breif Whether to utilize cosine scaling for the module states

Cosine Scaling scales the magnitude of the drive motor to the cosine of the difference in angle between the azimuths target and current state.

◆ deadband

units::meters_per_second_t valor::swerve::requests::ApplyState::deadband = 0_mps

Minimum wheel speed required before motion is applied.

Speeds below this threshold are treated as zero to prevent unintended module movement or jitter.

◆ feedforward

BaseController::Output valor::swerve::requests::ApplyState::feedforward = 0

Optional feedforward output for the swerve module.

Used to apply additional controller output alongside the desired module state.

◆ optimize

bool valor::swerve::requests::ApplyState::optimize = true

Whether to optimize the module state.

Optimization minimizes unnecessary steering rotation by potentially reversing wheel direction.

◆ outputType

OutputType valor::swerve::requests::ApplyState::outputType = OutputType::Velocity

Output control mode used when applying drive requests.

Determines how wheel speed commands are interpreted by the drive motor controllers, such as closed-loop velocity, direct voltage, or normalized duty cycle control.

◆ state

frc::SwerveModuleState valor::swerve::requests::ApplyState::state

Desired state for the swerve module.

Contains the target wheel speed and steering angle.


The documentation for this struct was generated from the following file:
  • src/main/include/valkyrie/drivetrain/swerve/Requests.h