CTRE Phoenix 6 C++ 25.3.1
Loading...
Searching...
No Matches
ctre::phoenix6::swerve::requests::SysIdSwerveRotation Class Reference

SysId-specific SwerveRequest to characterize the rotational characteristics of a swerve drivetrain. More...

#include <ctre/phoenix6/swerve/SwerveRequest.hpp>

Inheritance diagram for ctre::phoenix6::swerve::requests::SysIdSwerveRotation:
ctre::phoenix6::swerve::requests::SwerveRequest

Public Member Functions

ctre::phoenix::StatusCode Apply (SwerveRequest::ControlParameters const &parameters, std::vector< std::unique_ptr< impl::SwerveModuleImpl > > const &modulesToApply) override
 Applies this swerve request to the given modules.
 
SysIdSwerveRotationWithRotationalRate (units::radians_per_second_t rotationalRate) &
 Update the angular rate to rotate at, in radians per second.
 
SysIdSwerveRotation && WithRotationalRate (units::radians_per_second_t rotationalRate) &&
 Update the angular rate to rotate at, in radians per second.
 
- Public Member Functions inherited from ctre::phoenix6::swerve::requests::SwerveRequest
virtual ~SwerveRequest ()=default
 

Public Attributes

units::radians_per_second_t RotationalRate = 0_rad_per_s
 The angular rate to rotate at, in radians per second.
 

Additional Inherited Members

- Public Types inherited from ctre::phoenix6::swerve::requests::SwerveRequest
using ControlParameters = impl::SwerveDrivetrainImpl::ControlParameters
 

Detailed Description

SysId-specific SwerveRequest to characterize the rotational characteristics of a swerve drivetrain.

This is useful to characterize the heading controller for FieldCentricFacingAngle.

The RotationalRate of this swerve request should be logged. When importing the log to SysId, set the "voltage" to RotationalRate, "position" to the Pigeon 2 Yaw, and "velocity" to the Pigeon 2 AngularVelocityZWorld. Note that the position and velocity will both need to be scaled by pi/180.

Alternatively, the MotorVoltage of one of the drive motors can be loaded into the SysId "voltage" field, which can be useful when determining the MOI of the robot.

Member Function Documentation

◆ Apply()

ctre::phoenix::StatusCode ctre::phoenix6::swerve::requests::SysIdSwerveRotation::Apply ( SwerveRequest::ControlParameters const & parameters,
std::vector< std::unique_ptr< impl::SwerveModuleImpl > > const & modulesToApply )
inlineoverridevirtual

Applies this swerve request to the given modules.

This is typically called by the SwerveDrivetrain.

Parameters
parametersParameters the control request needs to calculate the module state
modulesToApplyModules to which the control request is applied
Returns
Status code of sending the request

Implements ctre::phoenix6::swerve::requests::SwerveRequest.

◆ WithRotationalRate() [1/2]

SysIdSwerveRotation & ctre::phoenix6::swerve::requests::SysIdSwerveRotation::WithRotationalRate ( units::radians_per_second_t rotationalRate) &
inline

Update the angular rate to rotate at, in radians per second.

Parameters
rotationalRateAngular rate to rotate at
Returns
this request

◆ WithRotationalRate() [2/2]

SysIdSwerveRotation && ctre::phoenix6::swerve::requests::SysIdSwerveRotation::WithRotationalRate ( units::radians_per_second_t rotationalRate) &&
inline

Update the angular rate to rotate at, in radians per second.

Parameters
rotationalRateAngular rate to rotate at
Returns
this request

Member Data Documentation

◆ RotationalRate

units::radians_per_second_t ctre::phoenix6::swerve::requests::SysIdSwerveRotation::RotationalRate = 0_rad_per_s

The angular rate to rotate at, in radians per second.


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