Class SwerveRequest.FieldCentricFacingAngle

java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.SwerveRequest.FieldCentricFacingAngle
All Implemented Interfaces:
SwerveRequest
Enclosing interface:
SwerveRequest

public static class SwerveRequest.FieldCentricFacingAngle
extends Object
implements SwerveRequest
Drives the swerve drivetrain in a field-centric manner, maintaining a specified heading angle to ensure the robot is facing the desired direction

When users use this request, they specify the direction the robot should travel oriented against the field, and the direction the robot should be facing.

An example scenario is that the robot is oriented to the east, the VelocityX is +5 m/s, VelocityY is 0 m/s, and TargetDirection is 180 degrees. In this scenario, the robot would drive northward at 5 m/s and turn clockwise to a target of 180 degrees.

This control request is especially useful for autonomous control, where the robot should be facing a changing direction throughout the motion.