What to know before using Pathplanner?

Hello, so our team has been looking into ways of improving our auto code and came across Pathplanner and it’s accompanying library, while it looks awesome it would require a rather serious rewrite of our code to implement with the rest of our team’s library. As a result, we were wondering if there was any advice or warnings we should know about path planner and any limitations it may have before starting?

Edit: we are aware of the existing WPILivlb solutions to path planning and following and that is what we use now. And we are planning to use swerve. We were simply wondering if pathplanner might be a better option.

Thanks in advance!

One big one, are you running swerve? If not, a wpilib solution already exists and is supported by a community of developers.

For us, we used path planner because it was one of the first to support swerve drives.

1 Like

You do not need to use the pathplanner library to use pathplanner. You can export paths from pathplanner as wpilib json files and import them as outlined here. This is what my team did because we wanted to avoid learning a new library when we could just use existing WPILib solutions (but also have a much nicer interface for generating paths).

3 Likes

So my first question is why do u say it would take a big rewrite of ur code? Is it because ur not using command based programming? We implemented path planner last year it was pretty easy to use once we figured out how.

I would definitely invest the time into learning how to use Path Planner. There are a couple things to note here. You can use Path Planner to just build the paths using the top notch UI that has been developed, and then use what ever code you want to follow the paths. This is how we started at the beginning of 2022.

We used the WPIlib example code for c++ swerve drive command based project. It has a auto routine that follows an S-Curve, however it doesn’t support holonomic rotation. It only supports having the robot either always face the direction that it’s traveling or turn to a fixed end heading as the robot traverses the path. If you want to do more than that you need to get into the nut and bolts of what PP does in regards to holonomic rotation support.

In order to offer more advice we need a bit more info on your team as the answers to these question will shape the response to your initial question.
c++ or Java?
Using Command based framework or not?

1 Like

Yes, but then you use that JSON to create a WPILib trajectory, and the WPILib trajectory doesn’t let you specify the robot’s angle because it was made for differential drivetrains. When you use HolonomicDriveController, it ignores the angle information in the trajectory (which for a differential drive would just be the direction of travel), and instead follows a trapezoid profile to the angle of the end point.

That said, the HolonomicDriveController.calculate() method does let you specify your own angle setpoint- that’s why it also takes a Rotation2d and not just a Pose2d. But you can’t get it from the WPILib trajectory, that’s what I’m saying.

1 Like

Ah okay, we were just wondering if PathPlanner offered any kind of benefits over wpilib paths that couldn’t be replicated. Especially since our team library allready had stuff to deal with the rotation or trajectory attached events stuff that is also offered by pathplanner

We use command based but our team library already had thousands of lines of auton code that replicate parts of pathplanners functionality but eith wpilib trajectory stuff

So the big advantage of pathplanner is that it can handle holonomic drive trains. Also with the latest version they added the ability to make 1 path in the UI and then split it into multiple trajectories that can be then combined with commands in between.

I would argue that implementing path planner wouldn’t require major changes to at least test. This is our most complicated auto last year, https://github.com/Frc5572/FRC2022/blob/main/src/main/java/frc/robot/autos/P1_5B.java. if it works then u don’t need to maintain ur own library, if it doesn’t then u keep using what u have.