setDesiredState

fun setDesiredState(desiredState: SwerveModuleState, isOpenLoop: Boolean = false)

Sets the desired state for the swerve module.

Optimizes the target state to minimize rotation and applies the state to the motors.

Parameters

desiredState

The desired SwerveModuleState to achieve.

isOpenLoop

Whether to use open loop control (PWM) instead of closed loop.