PathPlanner Strange Swerve Pathing

Hi Chief Delphi,

We made a very basic 2 m. path that goes forward (screenshotted below). When simulating the path being run in telemetry, it looks fine. Furthermore, when the robot was on the cart (and the wheels were not in contact with any surface), the wheels moved as expected (this was tested once, will do further testing to confirm this behavior)

However, when we run the path on the robot, the path is executed, but then the robot makes a wild 180 degree turn at the very end of the path. Unsure why this is happening. The path’s starting position and ending position are identical. The only difference is that the path has a large rotation at the end.

I’ve attached snippets of the pathplanner code implementation below. Any guidance would be greatly appreciated.

Screenshot 2024-01-17 at 7.22.34 PM
^Telemetry shown on actual robot when auto is run (apologies for the blurry photo, but it is clear there is a rotation occurring).

Screenshot 2024-01-17 at 7.22.22 PM
^The intended robot path




^Code setup

Updating here: simulation is still not yielding any possible errors, but the robot on the cart seems to also want to rotate 180 degrees. Any suggestions would be greatly appreciated. We are mostly using 364’s method of operating swerve.

It’s very likely there’s nothing wrong with your Pathplanner setup. YAGSL used to have this issue. It’s potentially caused by it automatically swapping back to the default command (Teleop Drive) after it finishes the path.

1 Like

Any idea on how to resolve this? The PathPlanner setup only commands the drivebase robot relative, so I’m a little bit confused on the swapping you’re talking about.

I believe that @Technologyman00 is refering to once the Auto ends, the robot runs it’s default drive command, which may be turning it to a certain heading.

Might be worth trying just the Auton period, without teleop, if you can. Or disabling your default drive command to see if the issue persists.

Look into test mode for isolating certain commands (Like only running your auton command, and no drive command)

1 Like

It would be helpful to run it with PathPlanner attached. What does the “ghost robot” do? This helps you know what PathPlanner is doing.

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