Hi! My team built a swerve drive for the first time this year, and we’re encountering an issue that we haven’t been able to resolve. When driving forward and spinning at the same time, the robot skews significantly in the direction that it is rotating.
As far as I can tell, it’s the same problem that’s described in this post. We have tried the solutions suggested in that thread, even copying directly from other teams that implemented fixes for the issue, roughly:
private static ChassisSpeeds correctForDynamics(ChassisSpeeds originalSpeeds) {
final double dt = 0.02;
Pose2d futureRobotPose =
new Pose2d(
originalSpeeds.vxMetersPerSecond * dt,
originalSpeeds.vyMetersPerSecond * dt,
Rotation2d.fromRadians(originalSpeeds.omegaRadiansPerSecond * dt));
Twist2d twistForPose = log(futureRobotPose);
ChassisSpeeds updatedSpeeds =
new ChassisSpeeds(
twistForPose.dx / dt,
twistForPose.dy / dt,
twistForPose.dtheta / dt);
return updatedSpeeds;
}
As well as the implementation that will apparently be in WPILib 2024.
However we still haven’t been able to get rid of the problem. Are there any other things that we could try?
Are there any teams that have managed to solve this issue completely? Or is this just something that is inherent to swerve?
Thanks!