Accepts a generic field-centric ChassisSpeeds to apply to the drivetrain.
More...
#include <ctre/phoenix6/swerve/SwerveRequest.hpp>
Accepts a generic field-centric ChassisSpeeds to apply to the drivetrain.
◆ Apply()
Applies this swerve request to the given modules.
This is typically called by the SwerveDrivetrain.
- Parameters
-
parameters | Parameters the control request needs to calculate the module state |
modulesToApply | Modules to which the control request is applied |
- Returns
- Status code of sending the request
Implements ctre::phoenix6::swerve::requests::SwerveRequest.
◆ WithCenterOfRotation() [1/2]
ApplyFieldSpeeds & ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithCenterOfRotation |
( |
Translation2d | newCenterOfRotation | ) |
& |
|
inline |
Modifies the CenterOfRotation parameter and returns itself.
The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot.
- Parameters
-
newCenterOfRotation | Parameter to modify |
- Returns
- this object
◆ WithCenterOfRotation() [2/2]
ApplyFieldSpeeds && ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithCenterOfRotation |
( |
Translation2d | newCenterOfRotation | ) |
&& |
|
inline |
Modifies the CenterOfRotation parameter and returns itself.
The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot.
- Parameters
-
newCenterOfRotation | Parameter to modify |
- Returns
- this object
◆ WithDesaturateWheelSpeeds() [1/2]
ApplyFieldSpeeds & ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithDesaturateWheelSpeeds |
( |
bool | newDesaturateWheelSpeeds | ) |
& |
|
inline |
Modifies the DesaturateWheelSpeeds parameter and returns itself.
Whether to desaturate wheel speeds before applying. For more information, see the documentation of impl::SwerveDriveKinematics::DesaturateWheelSpeeds.
- Parameters
-
newDesaturateWheelSpeeds | Parameter to modify |
- Returns
- this object
◆ WithDesaturateWheelSpeeds() [2/2]
ApplyFieldSpeeds && ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithDesaturateWheelSpeeds |
( |
bool | newDesaturateWheelSpeeds | ) |
&& |
|
inline |
Modifies the DesaturateWheelSpeeds parameter and returns itself.
Whether to desaturate wheel speeds before applying. For more information, see the documentation of impl::SwerveDriveKinematics::DesaturateWheelSpeeds.
- Parameters
-
newDesaturateWheelSpeeds | Parameter to modify |
- Returns
- this object
◆ WithDriveRequestType() [1/2]
Modifies the DriveRequestType parameter and returns itself.
The type of control request to use for the drive motor.
- Parameters
-
newDriveRequestType | Parameter to modify |
- Returns
- this object
◆ WithDriveRequestType() [2/2]
Modifies the DriveRequestType parameter and returns itself.
The type of control request to use for the drive motor.
- Parameters
-
newDriveRequestType | Parameter to modify |
- Returns
- this object
◆ WithForwardPerspective() [1/2]
Modifies the ForwardPerspective parameter and returns itself.
The perspective to use when determining which direction is forward.
- Parameters
-
newForwardPerspective | Parameter to modify |
- Returns
- this object
◆ WithForwardPerspective() [2/2]
Modifies the ForwardPerspective parameter and returns itself.
The perspective to use when determining which direction is forward.
- Parameters
-
newForwardPerspective | Parameter to modify |
- Returns
- this object
◆ WithSpeeds() [1/2]
ApplyFieldSpeeds & ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithSpeeds |
( |
ChassisSpeeds | newSpeeds | ) |
& |
|
inline |
Modifies the Speeds parameter and returns itself.
The field-centric chassis speeds to apply to the drivetrain.
- Parameters
-
newSpeeds | Parameter to modify |
- Returns
- this object
◆ WithSpeeds() [2/2]
ApplyFieldSpeeds && ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithSpeeds |
( |
ChassisSpeeds | newSpeeds | ) |
&& |
|
inline |
Modifies the Speeds parameter and returns itself.
The field-centric chassis speeds to apply to the drivetrain.
- Parameters
-
newSpeeds | Parameter to modify |
- Returns
- this object
◆ WithSteerRequestType() [1/2]
Modifies the SteerRequestType parameter and returns itself.
The type of control request to use for the steer motor.
- Parameters
-
newSteerRequestType | Parameter to modify |
- Returns
- this object
◆ WithSteerRequestType() [2/2]
Modifies the SteerRequestType parameter and returns itself.
The type of control request to use for the steer motor.
- Parameters
-
newSteerRequestType | Parameter to modify |
- Returns
- this object
◆ WithWheelForceFeedforwardsX() [1/2]
ApplyFieldSpeeds & ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithWheelForceFeedforwardsX |
( |
std::vector< units::newton_t > | newWheelForceFeedforwardsX | ) |
& |
|
inline |
Modifies the WheelForceFeedforwardsX parameter and returns itself.
Field-centric wheel force feedforwards to apply in the X direction. X is defined as forward according to WPILib convention, so this determines the forward forces to apply.
These forces should include friction applied to the ground.
The order of the forces should match the order of the modules returned from SwerveDrivetrain.
- Parameters
-
newWheelForceFeedforwardsX | Parameter to modify |
- Returns
- this object
◆ WithWheelForceFeedforwardsX() [2/2]
ApplyFieldSpeeds && ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithWheelForceFeedforwardsX |
( |
std::vector< units::newton_t > | newWheelForceFeedforwardsX | ) |
&& |
|
inline |
Modifies the WheelForceFeedforwardsX parameter and returns itself.
Field-centric wheel force feedforwards to apply in the X direction. X is defined as forward according to WPILib convention, so this determines the forward forces to apply.
These forces should include friction applied to the ground.
The order of the forces should match the order of the modules returned from SwerveDrivetrain.
- Parameters
-
newWheelForceFeedforwardsX | Parameter to modify |
- Returns
- this object
◆ WithWheelForceFeedforwardsY() [1/2]
ApplyFieldSpeeds & ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithWheelForceFeedforwardsY |
( |
std::vector< units::newton_t > | newWheelForceFeedforwardsY | ) |
& |
|
inline |
Modifies the WheelForceFeedforwardsY parameter and returns itself.
Field-centric wheel force feedforwards to apply in the Y direction. Y is defined as to the left according to WPILib convention, so this determines the forces to apply to the left.
These forces should include friction applied to the ground.
The order of the forces should match the order of the modules returned from SwerveDrivetrain.
- Parameters
-
newWheelForceFeedforwardsY | Parameter to modify |
- Returns
- this object
◆ WithWheelForceFeedforwardsY() [2/2]
ApplyFieldSpeeds && ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WithWheelForceFeedforwardsY |
( |
std::vector< units::newton_t > | newWheelForceFeedforwardsY | ) |
&& |
|
inline |
Modifies the WheelForceFeedforwardsY parameter and returns itself.
Field-centric wheel force feedforwards to apply in the Y direction. Y is defined as to the left according to WPILib convention, so this determines the forces to apply to the left.
These forces should include friction applied to the ground.
The order of the forces should match the order of the modules returned from SwerveDrivetrain.
- Parameters
-
newWheelForceFeedforwardsY | Parameter to modify |
- Returns
- this object
◆ CenterOfRotation
Translation2d ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::CenterOfRotation {} |
The center of rotation to rotate around.
◆ DesaturateWheelSpeeds
bool ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::DesaturateWheelSpeeds = true |
◆ DriveRequestType
The type of control request to use for the drive motor.
◆ ForwardPerspective
The perspective to use when determining which direction is forward.
◆ Speeds
ChassisSpeeds ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::Speeds {} |
The field-centric chassis speeds to apply to the drivetrain.
◆ SteerRequestType
The type of control request to use for the steer motor.
◆ WheelForceFeedforwardsX
std::vector<units::newton_t> ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WheelForceFeedforwardsX |
Field-centric wheel force feedforwards to apply in the X direction.
X is defined as forward according to WPILib convention, so this determines the forward forces to apply.
These forces should include friction applied to the ground.
The order of the forces should match the order of the modules returned from SwerveDrivetrain.
◆ WheelForceFeedforwardsY
std::vector<units::newton_t> ctre::phoenix6::swerve::requests::ApplyFieldSpeeds::WheelForceFeedforwardsY |
Field-centric wheel force feedforwards to apply in the Y direction.
Y is defined as to the left according to WPILib convention, so this determines the forces to apply to the left.
These forces should include friction applied to the ground.
The order of the forces should match the order of the modules returned from SwerveDrivetrain.
The documentation for this class was generated from the following file: