Swerve odometry inverted axis

Heyy, so my Team is working getting our swerve working to a 100%, and it is almost done, the only problem we have is that we have odometry but when seeing it on the Shuffleboard, the left-right axis is iinverted, so if the chassis goes to the right, on the odometry we see it as going to the left. Here is the code and we hope someone can help us.

1 Like

Any chance you can add more detail or screenshots? More info would likely help in solving this problem, but here’s what I’m seeing in your code:

I am assuming that you are not looking at your limelight data on shuffleboard:

Image

image

But rather, looking at your encoder values for your turning motors & drive motors:

Provided that you are looking at these data values, I’d recommend that you double check you have the right data/numbers in shuffleboard itself, and then start testing variables.

Ideas of what should be tested:

  • Could any inversion(s) be messing with stuff?
  • Is your gyro orientation (hardware & software) correct?
    ^ Your gyro being backwards might cause your issue
  • Try manually inverting the values before you output them to shuffleboard, if all else fails. (Make sure this doesn’t affect any actual driving)
1 Like