Swerve Module Optimization Issues

Hello, I am having issues with swerve module angle optimization.

Here are the symptoms we are experiencing:

  • Lateral movements are working, turning does not
  • Turning while driving works momentarily
  • After turning while driving, turning works, lateral movements do not

We’ve noticed that if the robot isn’t driving/turning, it’s because wheels are spinning towards each other.

We are using the code from here for our optimization.

If you need any other details, please let me know.

This could happen if not all the angle motors spin in alignment. You might need to invert one or two.
Put it up on blocks, and steer to a 45 degree angle, and see if all the wheels point the same direction.
Also double check that all the motor’s deviceNumber values are correct and unique.

BaseMotorController.setInverted can switch the response of motors, including the angle motors.

Good luck!

We looked into that earlier, but that doesn’t appear to be the issue. Without optimization, the robot drives as expected (with the robot flipping the wheels around rather than just driving the wheels backwards).

That’s why I suggested causing the wheels to rotate to 45 degrees on blocks, so you can verify the wheel angles visually, and isolate if all wheels are orienting themselves consistently.
Doing a 180 degree drive direction change will hide an angle motor that is in inverse settings, because X + 180 = X - 180
Doing a 90 degree path is also confusing, as the wheels are all pointing sideways, but one just spins the opposite way.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.