CTRE Swerve Odometry Inverted

I just have the default ctre swerve drive project generated successfully with sds. but the built in odometry is inverted. it drives Fine but the pose is always off. The pose will go left when the robot moves right, forward when backward, everything is inverted EXCEPT rotation which is fine for some reason. Is there any way to fix this? In theory everything works on the field but if I want to use the pose it wlll always be off.

You might find this thread useful: Pathplanner path following issues - #2 by bovlb

Do you have any telemetry on your odometry, such as a Field2d? Does that track what you tell the robot to do, or what it actually does?

1 Like

Two suggestions:

  1. Confirm that you have written all your paths in BLUE origin. Test the paths on the blue side first, then switch to the red side to see if this is a mirroring issue.
  2. Use the Field2d widget described by @bovlb. Or open PathPlanner telemetry. These tools tel you where the robot “thinks” it is.

With no vision, moving left moves right, moving forward moves backward, etc. Viewing field on advantagescope shows this. Vision puts it back in correct place though

There should be booleans in the tuner constants file to invert each side of the drive. Flipping those should fix your issue. I think you will have to invert your controller inputs, though.

1 Like

Is the facing of the robot showing correctly?

If it is, I guess you mixed up the front and back of your drive when configuring it in Phoenix tuner.
The solution would be to

2 Likes

Yep we will take a look at that thanks

2 Likes