Package com.ctre.phoenix6.swerve
Interface SwerveRequest.NativeSwerveRequest
- All Superinterfaces:
SwerveRequest
- All Known Implementing Classes:
SwerveRequest.ApplyChassisSpeeds
,SwerveRequest.ApplyFieldSpeeds
,SwerveRequest.ApplyRobotSpeeds
,SwerveRequest.FieldCentric
,SwerveRequest.Idle
,SwerveRequest.PointWheelsAt
,SwerveRequest.RobotCentric
,SwerveRequest.SwerveDriveBrake
- Enclosing interface:
- SwerveRequest
Swerve requests implemented in native code.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyNative
(int id) Applies a native swerve request to the native drivetrain with the provided ID.Methods inherited from interface com.ctre.phoenix6.swerve.SwerveRequest
apply
-
Method Details
-
applyNative
Applies a native swerve request to the native drivetrain with the provided ID.When this is implemented, the regular
SwerveRequest.apply(com.ctre.phoenix6.swerve.SwerveDrivetrain.SwerveControlParameters, com.ctre.phoenix6.swerve.SwerveModule...)
function should do nothing (return OK). Additionally, this cannot be called from another swerve request's apply method, as this overrides the native swerve request of the drivetrain.Unlike
SwerveRequest.apply(com.ctre.phoenix6.swerve.SwerveDrivetrain.SwerveControlParameters, com.ctre.phoenix6.swerve.SwerveModule...)
, this function is called every timeSwerveDrivetrain.setControl(com.ctre.phoenix6.swerve.SwerveRequest)
is run, not every loop of the odometry thread. Instead, the underlying native request is run at the full update frequency of the odometry thread.- Parameters:
id
- ID of the native swerve drivetrain
-