We’ve been working on getting PathPlanner going on our swerve, but we’ve run into a weird issue where PathPlanner seems to be acting as though it’s whole coordinate system is inverted as compared to the odometry.
We first just tried a simple path that drove the swerve forward one meter, but that had a weird issue where it drive backwards instead of forwards, and would all the sudden do a 360. On a hunch that PathPlanner was trying to correct for the swerve turning slightly as it drives, and getting an inverted reading from the gyro, and then trying to turn the wrong way because of that, we tried un-inverting the gyro (we use a NavX2, which reads clockwise positive), and that did seem to fix it from doing the 360, but it still went backwards and the odometry tracking was wrong in teleop. So then we went back to inverting the reading from the gyro, and just inverted it again when PathPlanner grabs the current position from the odometry, and that seemed to work fine, other than the swerve still driving backwards.
We then tried a slightly more complex path that would drive the robot forwards a bit, and then to the right, while rotating to the counterclockwise. Instead, the robot went backwards a bit, rotated to the clockwise, started going to the left, and then started accelerating very rapidly to the right, until it was disabled to stop it from bashing into a wall. The telemetry page on the PathPlanner app said the robot was following the path until the end when it started going the wrong way. I didn’t get video or screenshots of this at the time, I can try to later today, but here’s some from the PathPlanner UI that I just made:
What we wanted:
What it seemed like it wanted to do:
What it actually did:
Our github is here
Any help would be appreciated!