:py:mod:`phoenix6.swerve.requests` ================================== .. py:module:: phoenix6.swerve.requests Module Contents --------------- Attributes ~~~~~~~~~~ .. autoapisummary:: phoenix6.swerve.requests.USE_WPILIB .. py:data:: USE_WPILIB :value: 'True' .. py:class:: ForwardPerspectiveValue(*args, **kwds) Bases: :py:obj:`enum.Enum` In field-centric control, the direction of "forward" is sometimes different depending on perspective. This addresses which forward to use. .. py:attribute:: OPERATOR_PERSPECTIVE :value: '0' "Forward" (positive X) is determined from the operator's perspective. This is important for most teleop driven field-centric requests, where positive X means to drive away from the operator. Important: Users must specify the operator_perspective in the SwerveDrivetrain object .. py:attribute:: BLUE_ALLIANCE :value: '1' "Forward" (positive X) is always from the perspective of the blue alliance (i.e. towards the red alliance). This is important in situations such as path following where positive X is always from the blue alliance perspective, regardless of where the operator is physically located. .. py:class:: SwerveRequest Bases: :py:obj:`Protocol` Container for all the Swerve Requests. Use this to find all applicable swerve drive requests. This is also an interface common to all swerve drive control requests that allow the request to calculate the state to apply to the modules. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: NativeSwerveRequest Bases: :py:obj:`SwerveRequest`, :py:obj:`Protocol` Swerve requests implemented in native code. .. py:class:: Idle Bases: :py:obj:`NativeSwerveRequest` Does nothing to the swerve module state. This is the default state of a newly created swerve drive mechanism. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: SwerveDriveBrake Bases: :py:obj:`NativeSwerveRequest` Sets the swerve drive module states to point inward on the robot in an "X" fashion, creating a natural brake which will oppose any motion. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> SwerveDriveBrake Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: SwerveDriveBrake .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> SwerveDriveBrake Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: SwerveDriveBrake .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: FieldCentric Bases: :py:obj:`NativeSwerveRequest` Drives the swerve drivetrain in a field-centric manner. This request is optimized for joystick control during teleop with built-in deadbands. This request specifies the direction the robot should travel oriented against the field, and the rate at which their robot should rotate about the center of the robot. An example scenario is that the robot is oriented to the field +Y (left), the VelocityX is +5 m/s, VelocityY is 0 m/s, and RotationRate is 0.5 rad/s. In this scenario, the robot would drive along the field +X (forward) at 5 m/s and turn counterclockwise at 0.5 rad/s. .. py:attribute:: velocity_x :type: phoenix6.units.meters_per_second :value: '0' The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. .. py:attribute:: velocity_y :type: phoenix6.units.meters_per_second :value: '0' The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. .. py:attribute:: rotational_rate :type: phoenix6.units.radians_per_second :value: '0' The angular rate to rotate at, in radians per second. Angular rate is defined as counterclockwise positive, so this determines how fast to turn counterclockwise. .. py:attribute:: deadband :type: phoenix6.units.meters_per_second :value: '0' The allowable deadband of the request, in m/s. .. py:attribute:: rotational_deadband :type: phoenix6.units.radians_per_second :value: '0' The rotational deadband of the request, in radians per second. .. py:attribute:: center_of_rotation :type: Translation2d The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:attribute:: desaturate_wheel_speeds :type: bool :value: 'True' Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. .. py:attribute:: forward_perspective :type: ForwardPerspectiveValue The perspective to use when determining which direction is forward. .. py:method:: with_velocity_x(new_velocity_x: phoenix6.units.meters_per_second) -> FieldCentric Modifies the velocity_x parameter and returns itself. The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. :param new_velocity_x: Parameter to modify :type new_velocity_x: meters_per_second :returns: this object :rtype: FieldCentric .. py:method:: with_velocity_y(new_velocity_y: phoenix6.units.meters_per_second) -> FieldCentric Modifies the velocity_y parameter and returns itself. The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. :param new_velocity_y: Parameter to modify :type new_velocity_y: meters_per_second :returns: this object :rtype: FieldCentric .. py:method:: with_rotational_rate(new_rotational_rate: phoenix6.units.radians_per_second) -> FieldCentric Modifies the rotational_rate parameter and returns itself. The angular rate to rotate at, in radians per second. Angular rate is defined as counterclockwise positive, so this determines how fast to turn counterclockwise. :param new_rotational_rate: Parameter to modify :type new_rotational_rate: radians_per_second :returns: this object :rtype: FieldCentric .. py:method:: with_deadband(new_deadband: phoenix6.units.meters_per_second) -> FieldCentric Modifies the deadband parameter and returns itself. The allowable deadband of the request, in m/s. :param new_deadband: Parameter to modify :type new_deadband: meters_per_second :returns: this object :rtype: FieldCentric .. py:method:: with_rotational_deadband(new_rotational_deadband: phoenix6.units.radians_per_second) -> FieldCentric Modifies the rotational_deadband parameter and returns itself. The rotational deadband of the request, in radians per second. :param new_rotational_deadband: Parameter to modify :type new_rotational_deadband: radians_per_second :returns: this object :rtype: FieldCentric .. py:method:: with_center_of_rotation(new_center_of_rotation: Translation2d) -> FieldCentric Modifies the center_of_rotation 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. :param new_center_of_rotation: Parameter to modify :type new_center_of_rotation: Translation2d :returns: this object :rtype: FieldCentric .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> FieldCentric Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: FieldCentric .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> FieldCentric Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: FieldCentric .. py:method:: with_desaturate_wheel_speeds(new_desaturate_wheel_speeds: bool) -> FieldCentric Modifies the desaturate_wheel_speeds parameter and returns itself. Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. :param new_desaturate_wheel_speeds: Parameter to modify :type new_desaturate_wheel_speeds: bool :returns: this object :rtype: FieldCentric .. py:method:: with_forward_perspective(new_forward_perspective: ForwardPerspectiveValue) -> FieldCentric Modifies the forward_perspective parameter and returns itself. The perspective to use when determining which direction is forward. :param new_forward_perspective: Parameter to modify :type new_forward_perspective: ForwardPerspectiveValue :returns: this object :rtype: FieldCentric .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: RobotCentric Bases: :py:obj:`NativeSwerveRequest` Drives the swerve drivetrain in a robot-centric manner. This request is optimized for joystick control during teleop with built-in deadbands. This request specifies the direction the robot should travel oriented against the robot itself, and the rate at which their robot should rotate about the center of the robot. An example scenario is that the robot is oriented to the field +Y (left), the VelocityX is +5 m/s, VelocityY is 0 m/s, and RotationRate is 0.5 rad/s. In this scenario, the robot would drive forward relative to itself (or left along the field +Y) at 5 m/s and turn counterclockwise at 0.5 rad/s. .. py:attribute:: velocity_x :type: phoenix6.units.meters_per_second :value: '0' The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. .. py:attribute:: velocity_y :type: phoenix6.units.meters_per_second :value: '0' The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. .. py:attribute:: rotational_rate :type: phoenix6.units.radians_per_second :value: '0' The angular rate to rotate at, in radians per second. Angular rate is defined as counterclockwise positive, so this determines how fast to turn counterclockwise. .. py:attribute:: deadband :type: phoenix6.units.meters_per_second :value: '0' The allowable deadband of the request, in m/s. .. py:attribute:: rotational_deadband :type: phoenix6.units.radians_per_second :value: '0' The rotational deadband of the request, in radians per second. .. py:attribute:: center_of_rotation :type: Translation2d The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:attribute:: desaturate_wheel_speeds :type: bool :value: 'True' Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. .. py:method:: with_velocity_x(new_velocity_x: phoenix6.units.meters_per_second) -> RobotCentric Modifies the velocity_x parameter and returns itself. The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. :param new_velocity_x: Parameter to modify :type new_velocity_x: meters_per_second :returns: this object :rtype: RobotCentric .. py:method:: with_velocity_y(new_velocity_y: phoenix6.units.meters_per_second) -> RobotCentric Modifies the velocity_y parameter and returns itself. The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. :param new_velocity_y: Parameter to modify :type new_velocity_y: meters_per_second :returns: this object :rtype: RobotCentric .. py:method:: with_rotational_rate(new_rotational_rate: phoenix6.units.radians_per_second) -> RobotCentric Modifies the rotational_rate parameter and returns itself. The angular rate to rotate at, in radians per second. Angular rate is defined as counterclockwise positive, so this determines how fast to turn counterclockwise. :param new_rotational_rate: Parameter to modify :type new_rotational_rate: radians_per_second :returns: this object :rtype: RobotCentric .. py:method:: with_deadband(new_deadband: phoenix6.units.meters_per_second) -> RobotCentric Modifies the deadband parameter and returns itself. The allowable deadband of the request, in m/s. :param new_deadband: Parameter to modify :type new_deadband: meters_per_second :returns: this object :rtype: RobotCentric .. py:method:: with_rotational_deadband(new_rotational_deadband: phoenix6.units.radians_per_second) -> RobotCentric Modifies the rotational_deadband parameter and returns itself. The rotational deadband of the request, in radians per second. :param new_rotational_deadband: Parameter to modify :type new_rotational_deadband: radians_per_second :returns: this object :rtype: RobotCentric .. py:method:: with_center_of_rotation(new_center_of_rotation: Translation2d) -> RobotCentric Modifies the center_of_rotation 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. :param new_center_of_rotation: Parameter to modify :type new_center_of_rotation: Translation2d :returns: this object :rtype: RobotCentric .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> RobotCentric Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: RobotCentric .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> RobotCentric Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: RobotCentric .. py:method:: with_desaturate_wheel_speeds(new_desaturate_wheel_speeds: bool) -> RobotCentric Modifies the desaturate_wheel_speeds parameter and returns itself. Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. :param new_desaturate_wheel_speeds: Parameter to modify :type new_desaturate_wheel_speeds: bool :returns: this object :rtype: RobotCentric .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: PointWheelsAt Bases: :py:obj:`NativeSwerveRequest` Sets the swerve drive modules to point to a specified direction. .. py:attribute:: module_direction :type: Rotation2d The direction to point the modules toward. This direction is still optimized to what the module was previously at. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:method:: with_module_direction(new_module_direction: Rotation2d) -> PointWheelsAt Modifies the module_direction parameter and returns itself. The direction to point the modules toward. This direction is still optimized to what the module was previously at. :param new_module_direction: Parameter to modify :type new_module_direction: Rotation2d :returns: this object :rtype: PointWheelsAt .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> PointWheelsAt Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: PointWheelsAt .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> PointWheelsAt Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: PointWheelsAt .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: ApplyRobotSpeeds Bases: :py:obj:`NativeSwerveRequest` Accepts a generic robot-centric ChassisSpeeds to apply to the drivetrain. This request is optimized for autonomous or profiled control, which typically directly provides ChassisSpeeds and optionally wheel force feedforwards. Unlike the field-centric requests, this request does not automatically discretize the provided ChassisSpeeds. .. py:attribute:: speeds :type: ChassisSpeeds The robot-centric chassis speeds to apply to the drivetrain. Users must manually discretize these speeds if appropriate. .. py:attribute:: wheel_force_feedforwards_x :type: list[phoenix6.units.newton] :value: '[]' Robot-centric wheel force feedforwards to apply in the X direction, in newtons. 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. .. py:attribute:: wheel_force_feedforwards_y :type: list[phoenix6.units.newton] :value: '[]' Robot-centric wheel force feedforwards to apply in the Y direction, in newtons. 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. .. py:attribute:: center_of_rotation :type: Translation2d The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:attribute:: desaturate_wheel_speeds :type: bool :value: 'True' Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. .. py:method:: with_speeds(new_speeds: ChassisSpeeds) -> ApplyRobotSpeeds Modifies the speeds parameter and returns itself. The robot-centric chassis speeds to apply to the drivetrain. Users must manually discretize these speeds if appropriate. :param new_speeds: Parameter to modify :type new_speeds: ChassisSpeeds :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: with_wheel_force_feedforwards_x(new_wheel_force_feedforwards_x: list[phoenix6.units.newton]) -> ApplyRobotSpeeds Modifies the wheel_force_feedforwards_x parameter and returns itself. Robot-centric wheel force feedforwards to apply in the X direction, in newtons. 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. :param new_wheel_force_feedforwards_x: Parameter to modify :type new_wheel_force_feedforwards_x: list[newton] :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: with_wheel_force_feedforwards_y(new_wheel_force_feedforwards_y: list[phoenix6.units.newton]) -> ApplyRobotSpeeds Modifies the wheel_force_feedforwards_y parameter and returns itself. Robot-centric wheel force feedforwards to apply in the Y direction, in newtons. 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. :param new_wheel_force_feedforwards_y: Parameter to modify :type new_wheel_force_feedforwards_y: list[newton] :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: with_center_of_rotation(new_center_of_rotation: Translation2d) -> ApplyRobotSpeeds Modifies the center_of_rotation 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. :param new_center_of_rotation: Parameter to modify :type new_center_of_rotation: Translation2d :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> ApplyRobotSpeeds Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> ApplyRobotSpeeds Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: with_desaturate_wheel_speeds(new_desaturate_wheel_speeds: bool) -> ApplyRobotSpeeds Modifies the desaturate_wheel_speeds parameter and returns itself. Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. :param new_desaturate_wheel_speeds: Parameter to modify :type new_desaturate_wheel_speeds: bool :returns: this object :rtype: ApplyRobotSpeeds .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: ApplyFieldSpeeds Bases: :py:obj:`NativeSwerveRequest` Accepts a generic field-centric ChassisSpeeds to apply to the drivetrain. This request is optimized for autonomous or profiled control, which typically directly provides ChassisSpeeds and optionally wheel force feedforwards. .. py:attribute:: speeds :type: ChassisSpeeds The field-centric chassis speeds to apply to the drivetrain. .. py:attribute:: wheel_force_feedforwards_x :type: list[phoenix6.units.newton] :value: '[]' Field-centric wheel force feedforwards to apply in the X direction, in newtons. 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. .. py:attribute:: wheel_force_feedforwards_y :type: list[phoenix6.units.newton] :value: '[]' Field-centric wheel force feedforwards to apply in the Y direction, in newtons. 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. .. py:attribute:: center_of_rotation :type: Translation2d The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:attribute:: desaturate_wheel_speeds :type: bool :value: 'True' Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. .. py:attribute:: forward_perspective :type: ForwardPerspectiveValue The perspective to use when determining which direction is forward. .. py:method:: with_speeds(new_speeds: ChassisSpeeds) -> ApplyFieldSpeeds Modifies the speeds parameter and returns itself. The field-centric chassis speeds to apply to the drivetrain. :param new_speeds: Parameter to modify :type new_speeds: ChassisSpeeds :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_wheel_force_feedforwards_x(new_wheel_force_feedforwards_x: list[phoenix6.units.newton]) -> ApplyFieldSpeeds Modifies the wheel_force_feedforwards_x parameter and returns itself. Field-centric wheel force feedforwards to apply in the X direction, in newtons. 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. :param new_wheel_force_feedforwards_x: Parameter to modify :type new_wheel_force_feedforwards_x: list[newton] :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_wheel_force_feedforwards_y(new_wheel_force_feedforwards_y: list[phoenix6.units.newton]) -> ApplyFieldSpeeds Modifies the wheel_force_feedforwards_y parameter and returns itself. Field-centric wheel force feedforwards to apply in the Y direction, in newtons. 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. :param new_wheel_force_feedforwards_y: Parameter to modify :type new_wheel_force_feedforwards_y: list[newton] :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_center_of_rotation(new_center_of_rotation: Translation2d) -> ApplyFieldSpeeds Modifies the center_of_rotation 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. :param new_center_of_rotation: Parameter to modify :type new_center_of_rotation: Translation2d :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> ApplyFieldSpeeds Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> ApplyFieldSpeeds Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_desaturate_wheel_speeds(new_desaturate_wheel_speeds: bool) -> ApplyFieldSpeeds Modifies the desaturate_wheel_speeds parameter and returns itself. Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. :param new_desaturate_wheel_speeds: Parameter to modify :type new_desaturate_wheel_speeds: bool :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: with_forward_perspective(new_forward_perspective: ForwardPerspectiveValue) -> ApplyFieldSpeeds Modifies the forward_perspective parameter and returns itself. The perspective to use when determining which direction is forward. :param new_forward_perspective: Parameter to modify :type new_forward_perspective: ForwardPerspectiveValue :returns: this object :rtype: ApplyFieldSpeeds .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:class:: FieldCentricFacingAngle Bases: :py:obj:`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. .. py:attribute:: velocity_x :type: phoenix6.units.meters_per_second :value: '0' The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. .. py:attribute:: velocity_y :type: phoenix6.units.meters_per_second :value: '0' The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. .. py:attribute:: target_direction :type: Rotation2d The desired direction to face. 0 Degrees is defined as in the direction of the X axis. As a result, a TargetDirection of 90 degrees will point along the Y axis, or to the left. .. py:attribute:: target_rate_feedforward :type: phoenix6.units.radians_per_second :value: '0' The rotational rate feedforward to add to the output of the heading controller, in radians per second. When using a motion profile for the target direction, this can be set to the current velocity reference of the profile. .. py:attribute:: deadband :type: phoenix6.units.meters_per_second :value: '0' The allowable deadband of the request, in m/s. .. py:attribute:: rotational_deadband :type: phoenix6.units.radians_per_second :value: '0' The rotational deadband of the request, in radians per second. .. py:attribute:: max_abs_rotational_rate :type: phoenix6.units.radians_per_second :value: '0' The maximum absolute rotational rate to allow, in radians per second. Setting this to 0 results in no cap to rotational rate. .. py:attribute:: center_of_rotation :type: Translation2d The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:attribute:: desaturate_wheel_speeds :type: bool :value: 'True' Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. .. py:attribute:: forward_perspective :type: ForwardPerspectiveValue The perspective to use when determining which direction is forward. .. py:attribute:: heading_controller :type: phoenix6.swerve.utility.phoenix_pid_controller.PhoenixPIDController The PID controller used to maintain the desired heading. Users can specify the PID gains to change how aggressively to maintain heading. This PID controller operates on heading radians and outputs a target rotational rate in radians per second. Note that continuous input should be enabled on the range [-pi, pi]. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:method:: with_heading_pid(kp: float, ki: float, kd: float) -> FieldCentricFacingAngle Modifies the PID gains of the heading_controller parameter and returns itself. Sets the proportional, integral, and differential coefficients used to maintain the desired heading. Users can specify the PID gains to change how aggressively to maintain heading. This PID controller operates on heading radians and outputs a target rotational rate in radians per second. :param kp: The proportional coefficient; must be >= 0 :type kp: float :param ki: The integral coefficient; must be >= 0 :type ki: float :param kd: The differential coefficient; must be >= 0 :type kd: float :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_velocity_x(new_velocity_x: phoenix6.units.meters_per_second) -> FieldCentricFacingAngle Modifies the velocity_x parameter and returns itself. The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. :param new_velocity_x: Parameter to modify :type new_velocity_x: meters_per_second :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_velocity_y(new_velocity_y: phoenix6.units.meters_per_second) -> FieldCentricFacingAngle Modifies the velocity_y parameter and returns itself. The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. :param new_velocity_y: Parameter to modify :type new_velocity_y: meters_per_second :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_target_direction(new_target_direction: Rotation2d) -> FieldCentricFacingAngle Modifies the target_direction parameter and returns itself. The desired direction to face. 0 Degrees is defined as in the direction of the X axis. As a result, a TargetDirection of 90 degrees will point along the Y axis, or to the left. :param new_target_direction: Parameter to modify :type new_target_direction: Rotation2d :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_target_rate_feedforward(new_target_rate_feedforward: phoenix6.units.radians_per_second) -> FieldCentricFacingAngle Modifies the target_rate_feedforward parameter and returns itself. The rotational rate feedforward to add to the output of the heading controller, in radians per second. When using a motion profile for the target direction, this can be set to the current velocity reference of the profile. :param new_target_rate_feedforward: Parameter to modify :type new_target_rate_feedforward: radians_per_second :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_deadband(new_deadband: phoenix6.units.meters_per_second) -> FieldCentricFacingAngle Modifies the deadband parameter and returns itself. The allowable deadband of the request, in m/s. :param new_deadband: Parameter to modify :type new_deadband: meters_per_second :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_rotational_deadband(new_rotational_deadband: phoenix6.units.radians_per_second) -> FieldCentricFacingAngle Modifies the rotational_deadband parameter and returns itself. The rotational deadband of the request, in radians per second. :param new_rotational_deadband: Parameter to modify :type new_rotational_deadband: radians_per_second :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_max_abs_rotational_rate(new_max_abs_rotational_rate: phoenix6.units.radians_per_second) -> FieldCentricFacingAngle Modifies the max_abs_rotational_rate parameter and returns itself. The maximum absolute rotational rate to allow, in radians per second. Setting this to 0 results in no cap to rotational rate. :param new_max_abs_rotational_rate: Parameter to modify :type new_max_abs_rotational_rate: radians_per_second :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_center_of_rotation(new_center_of_rotation: Translation2d) -> FieldCentricFacingAngle Modifies the center_of_rotation 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. :param new_center_of_rotation: Parameter to modify :type new_center_of_rotation: Translation2d :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> FieldCentricFacingAngle Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> FieldCentricFacingAngle Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_desaturate_wheel_speeds(new_desaturate_wheel_speeds: bool) -> FieldCentricFacingAngle Modifies the desaturate_wheel_speeds parameter and returns itself. Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. :param new_desaturate_wheel_speeds: Parameter to modify :type new_desaturate_wheel_speeds: bool :returns: this object :rtype: FieldCentricFacingAngle .. py:method:: with_forward_perspective(new_forward_perspective: ForwardPerspectiveValue) -> FieldCentricFacingAngle Modifies the forward_perspective parameter and returns itself. The perspective to use when determining which direction is forward. :param new_forward_perspective: Parameter to modify :type new_forward_perspective: ForwardPerspectiveValue :returns: this object :rtype: FieldCentricFacingAngle .. py:class:: RobotCentricFacingAngle Bases: :py:obj:`SwerveRequest` Drives the swerve drivetrain in a robot-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 robot itself, and the direction the robot should be facing relative to the field. 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 forward at 5 m/s and turn clockwise to a target of 180 degrees. This control request is especially useful for vision control, where the robot should be facing a vision target throughout the motion. .. py:attribute:: velocity_x :type: phoenix6.units.meters_per_second :value: '0' The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. .. py:attribute:: velocity_y :type: phoenix6.units.meters_per_second :value: '0' The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. .. py:attribute:: target_direction :type: Rotation2d The desired direction to face. 0 Degrees is defined as in the direction of the X axis. As a result, a TargetDirection of 90 degrees will point along the Y axis, or to the left. .. py:attribute:: target_rate_feedforward :type: phoenix6.units.radians_per_second :value: '0' The rotational rate feedforward to add to the output of the heading controller, in radians per second. When using a motion profile for the target direction, this can be set to the current velocity reference of the profile. .. py:attribute:: deadband :type: phoenix6.units.meters_per_second :value: '0' The allowable deadband of the request, in m/s. .. py:attribute:: rotational_deadband :type: phoenix6.units.radians_per_second :value: '0' The rotational deadband of the request, in radians per second. .. py:attribute:: max_abs_rotational_rate :type: phoenix6.units.radians_per_second :value: '0' The maximum absolute rotational rate to allow, in radians per second. Setting this to 0 results in no cap to rotational rate. .. py:attribute:: center_of_rotation :type: Translation2d The center of rotation the robot should rotate around. This is (0,0) by default, which will rotate around the center of the robot. .. py:attribute:: drive_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType The type of control request to use for the drive motor. .. py:attribute:: steer_request_type :type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType The type of control request to use for the drive motor. .. py:attribute:: desaturate_wheel_speeds :type: bool :value: 'True' Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. .. py:attribute:: forward_perspective :type: ForwardPerspectiveValue The perspective to use when determining which direction is forward for the target heading. .. py:attribute:: heading_controller :type: phoenix6.swerve.utility.phoenix_pid_controller.PhoenixPIDController The PID controller used to maintain the desired heading. Users can specify the PID gains to change how aggressively to maintain heading. This PID controller operates on heading radians and outputs a target rotational rate in radians per second. Note that continuous input should be enabled on the range [-pi, pi]. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:method:: with_heading_pid(kp: float, ki: float, kd: float) -> RobotCentricFacingAngle Modifies the PID gains of the heading_controller parameter and returns itself. Sets the proportional, integral, and differential coefficients used to maintain the desired heading. Users can specify the PID gains to change how aggressively to maintain heading. This PID controller operates on heading radians and outputs a target rotational rate in radians per second. :param kp: The proportional coefficient; must be >= 0 :type kp: float :param ki: The integral coefficient; must be >= 0 :type ki: float :param kd: The differential coefficient; must be >= 0 :type kd: float :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_velocity_x(new_velocity_x: phoenix6.units.meters_per_second) -> RobotCentricFacingAngle Modifies the velocity_x parameter and returns itself. The velocity in the X direction, in m/s. X is defined as forward according to WPILib convention, so this determines how fast to travel forward. :param new_velocity_x: Parameter to modify :type new_velocity_x: meters_per_second :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_velocity_y(new_velocity_y: phoenix6.units.meters_per_second) -> RobotCentricFacingAngle Modifies the velocity_y parameter and returns itself. The velocity in the Y direction, in m/s. Y is defined as to the left according to WPILib convention, so this determines how fast to travel to the left. :param new_velocity_y: Parameter to modify :type new_velocity_y: meters_per_second :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_target_direction(new_target_direction: Rotation2d) -> RobotCentricFacingAngle Modifies the target_direction parameter and returns itself. The desired direction to face. 0 Degrees is defined as in the direction of the X axis. As a result, a TargetDirection of 90 degrees will point along the Y axis, or to the left. :param new_target_direction: Parameter to modify :type new_target_direction: Rotation2d :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_target_rate_feedforward(new_target_rate_feedforward: phoenix6.units.radians_per_second) -> RobotCentricFacingAngle Modifies the target_rate_feedforward parameter and returns itself. The rotational rate feedforward to add to the output of the heading controller, in radians per second. When using a motion profile for the target direction, this can be set to the current velocity reference of the profile. :param new_target_rate_feedforward: Parameter to modify :type new_target_rate_feedforward: radians_per_second :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_deadband(new_deadband: phoenix6.units.meters_per_second) -> RobotCentricFacingAngle Modifies the deadband parameter and returns itself. The allowable deadband of the request, in m/s. :param new_deadband: Parameter to modify :type new_deadband: meters_per_second :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_rotational_deadband(new_rotational_deadband: phoenix6.units.radians_per_second) -> RobotCentricFacingAngle Modifies the rotational_deadband parameter and returns itself. The rotational deadband of the request, in radians per second. :param new_rotational_deadband: Parameter to modify :type new_rotational_deadband: radians_per_second :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_max_abs_rotational_rate(new_max_abs_rotational_rate: phoenix6.units.radians_per_second) -> RobotCentricFacingAngle Modifies the max_abs_rotational_rate parameter and returns itself. The maximum absolute rotational rate to allow, in radians per second. Setting this to 0 results in no cap to rotational rate. :param new_max_abs_rotational_rate: Parameter to modify :type new_max_abs_rotational_rate: radians_per_second :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_center_of_rotation(new_center_of_rotation: Translation2d) -> RobotCentricFacingAngle Modifies the center_of_rotation 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. :param new_center_of_rotation: Parameter to modify :type new_center_of_rotation: Translation2d :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_drive_request_type(new_drive_request_type: phoenix6.swerve.swerve_module.SwerveModule.DriveRequestType) -> RobotCentricFacingAngle Modifies the drive_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_drive_request_type: Parameter to modify :type new_drive_request_type: SwerveModule.DriveRequestType :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_steer_request_type(new_steer_request_type: phoenix6.swerve.swerve_module.SwerveModule.SteerRequestType) -> RobotCentricFacingAngle Modifies the steer_request_type parameter and returns itself. The type of control request to use for the drive motor. :param new_steer_request_type: Parameter to modify :type new_steer_request_type: SwerveModule.SteerRequestType :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_desaturate_wheel_speeds(new_desaturate_wheel_speeds: bool) -> RobotCentricFacingAngle Modifies the desaturate_wheel_speeds parameter and returns itself. Whether to desaturate wheel speeds before applying. For more information, see the documentation of SwerveDriveKinematics.desaturateWheelSpeeds. :param new_desaturate_wheel_speeds: Parameter to modify :type new_desaturate_wheel_speeds: bool :returns: this object :rtype: RobotCentricFacingAngle .. py:method:: with_forward_perspective(new_forward_perspective: ForwardPerspectiveValue) -> RobotCentricFacingAngle Modifies the forward_perspective parameter and returns itself. The perspective to use when determining which direction is forward for the target heading. :param new_forward_perspective: Parameter to modify :type new_forward_perspective: ForwardPerspectiveValue :returns: this object :rtype: RobotCentricFacingAngle .. py:class:: SysIdSwerveTranslation Bases: :py:obj:`SwerveRequest` SysId-specific SwerveRequest to characterize the translational characteristics of a swerve drivetrain. .. py:attribute:: volts_to_apply :type: phoenix6.units.volt :value: '0.0' Voltage to apply to drive wheels. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:method:: with_volts(volts: phoenix6.units.volt) -> SysIdSwerveTranslation Sets the voltage to apply to the drive wheels. :param volts: Voltage to apply :type volts: volt :returns: this request :rtype: SysIdSwerveTranslation .. py:class:: SysIdSwerveRotation Bases: :py:obj:`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. .. py:attribute:: rotational_rate :type: phoenix6.units.radians_per_second :value: '0.0' The angular rate to rotate at, in radians per second. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:method:: with_rotational_rate(rotational_rate: phoenix6.units.radians_per_second) -> SysIdSwerveRotation Sets the angular rate to rotate at, in radians per second. :param rotational_rate: Angular rate to rotate at :type rotational_rate: radians_per_second :returns: this request :rtype: SysIdSwerveRotation .. py:class:: SysIdSwerveSteerGains Bases: :py:obj:`SwerveRequest` SysId-specific SwerveRequest to characterize the steer module characteristics of a swerve drivetrain. .. py:attribute:: volts_to_apply :type: phoenix6.units.volt :value: '0.0' Voltage to apply to steer wheels. .. py:method:: apply(parameters: phoenix6.swerve.swerve_drivetrain.SwerveControlParameters, modules_to_apply: list[phoenix6.swerve.swerve_module.SwerveModule]) -> phoenix6.status_code.StatusCode 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. :param parameters: Parameters the control request needs to calculate the module state :type parameters: SwerveControlParameters :param modules_to_apply: Modules to which the control request is applied :type modules_to_apply: list[SwerveModule] :returns: Status code of sending the request :rtype: StatusCode .. py:method:: with_volts(volts: phoenix6.units.volt) -> SysIdSwerveSteerGains Sets the voltage to apply to the steer wheels. :param volts: Voltage to apply :type volts: volt :returns: this request :rtype: SysIdSwerveSteerGains