Help with PathPlanner

PathProgram
I made this programming to run the path planner on my TankDrive base “I used a YouTube tutorial as a basis”, but when I run it autonomously, the robot’s speed is at its maximum and I can’t change it, does anyone know what could be wrong?

YTvideo This is the video I used as a base

Your code does not seen to use PathPlanner controller, but rather regular Ramsete command, the one in WPILIB.

Here is our 2023 competition code (that was a tank drive) that uses PathPlanner and can adjust speed. The speed adjustment is done here:

The two classes that actually run trajectories are:

RunTrajectorySequenceRobotAtStartPoint.java
AutonomousTrajectoryRioCommand.java

The first one reads the trajectory file and adjusts speed etc as needed. The second actually navigates trajectory.

Also this is a very simple demo project that just tests trajectory (may be easier to follow):

Thank you very much, I really need to use the path planner to participate in a competition at the end of this month

Also note that trajectory controller uses Velocity-based PID. That means it uses two parameters - maximum velocity and maximum acceleration expressed in SI units (m/s and m/s^2).
For the initial testing keep them reasonably low (usually no more than 1.5 m/s and say, 2 ms/^2) increase both PID values and the max constants above until you get them to the manageable state. Note also that the numbers being too low will result in a robot stopping early and not reaching the destination. Too high will make your robot jerky and overshooting, then returning back. So, you will find the right proportion in testing.
Also note that with Ramsete the main output of it is VOLTS that need to be applied to each motor controller (and obviously the volts are recalculated every 20 ms as you go along the trajectory)

With the right PID constants we found PathPlanner to be very precise, to less than 5cm error on about 10m run, if you do not have turns. Turns make it much more imprecise due to the side drag. So, we usually correct trajectories that need to be very precise, based on the IMU settings at the end.

I’m having the following problem importing the library
com.pathplanner.lib.commands

The import com.pathplanner.lib.commands.PPRamseteCommand cannot be resolvedJava(268435846)

all library imports are having this problem, do you know what it could be?

Did you do Import Vendor Library and other items described here:

I imported the library using the url, is there anything else I need to do?

Did you import the 2023 version or 2024 version?

The reason why I asked - PathPlanner 2024 version requires Beta 2024 version of WPILIB and beta version of NI RoboRIO image. So just checking if you used 2023 link. It’s on the same page

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