Package com.ctre.phoenix6.swerve
Class SwerveRequest.SysIdSwerveRotation
java.lang.Object
com.ctre.phoenix6.swerve.SwerveRequest.SysIdSwerveRotation
- All Implemented Interfaces:
SwerveRequest
- Enclosing interface:
- SwerveRequest
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ctre.phoenix6.swerve.SwerveRequest
SwerveRequest.ApplyChassisSpeeds, SwerveRequest.ApplyFieldSpeeds, SwerveRequest.ApplyRobotSpeeds, SwerveRequest.FieldCentric, SwerveRequest.FieldCentricFacingAngle, SwerveRequest.ForwardPerspectiveValue, SwerveRequest.Idle, SwerveRequest.NativeSwerveRequest, SwerveRequest.PointWheelsAt, SwerveRequest.RobotCentric, SwerveRequest.SwerveDriveBrake, SwerveRequest.SysIdSwerveRotation, SwerveRequest.SysIdSwerveSteerGains, SwerveRequest.SysIdSwerveTranslation
-
Field Summary
Modifier and TypeFieldDescriptiondouble
The angular rate to rotate at, in radians per second. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(SwerveDrivetrain.SwerveControlParameters parameters, SwerveModule<?, ?, ?>... modulesToApply) Applies this swerve request to the given modules.withRotationalRate
(double newRotationalRate) Update the angular rate to rotate at, in radians per second.withRotationalRate
(AngularVelocity newRotationalRate) Update the angular rate to rotate at.
-
Field Details
-
RotationalRate
The angular rate to rotate at, in radians per second.
-
-
Constructor Details
-
SysIdSwerveRotation
public SysIdSwerveRotation()
-
-
Method Details
-
apply
public StatusCode apply(SwerveDrivetrain.SwerveControlParameters parameters, SwerveModule<?, ?, ?>... modulesToApply) Description copied from interface:SwerveRequest
Applies this swerve request to the given modules. This is typically called by the SwerveDrivetrain odometry thread.For native swerve requests, this API can be called from a non-native request's
apply
to compose the two together.- Specified by:
apply
in interfaceSwerveRequest
- Parameters:
parameters
- Parameters the control request needs to calculate the module statemodulesToApply
- Modules to which the control request is applied- Returns:
- Status code of sending the request
-
withRotationalRate
Update the angular rate to rotate at, in radians per second.- Parameters:
newRotationalRate
- Angular rate to rotate at- Returns:
- this request
-
withRotationalRate
Update the angular rate to rotate at.- Parameters:
newRotationalRate
- The angular rate to rotate at- Returns:
- this request
-