Voltage constraint with pathweaver or pathplanner?

So my team is working on using trajectory autos, but we found that the voltage constraint is pretty important to getting a consistent result. Is there any way to apply this constraint using pathweaver/pathplanner paths, or do we need to just put in the waypoints manually?

If they generate the whole trajectory for the robot code to import, they don’t support constraints (plumbing all the required fields for the constraints is too tedious, I guess?). If you want them, you’ll need to copy-paste the waypoints into robot code and do the trajectory generation there.

3 Likes

This is one of the features that I’d like to see most in Pathweaver. It does a great job of generating and visualizing trajectories but it lacks the configurability of the wpilib TrajectoryGenerator. If there was an option to instead export only the waypoints so that the robot code can generate a trajectory with desired constraints that would be awesome as well. That way, speeds and constraints could be determined at runtime (run the same path at multiple speeds without having to create multiple paths in pathweaver)

This will likely be the design moving forward.

3 Likes

Here is the code from 6391 we use to read in waypoints from pathweaver. We manually copy and paste the waypoints from the pathweaver/Paths/ folder into our robot programs deploy folder (in a waypoints folder, i.e. deploy/waypoints).

The trajectory is generated in the drive subsystem and the ramsete command is here too.

Here is an example auto command that generates the trajectory on robot initialization while implementing the config/constraints. You can add additional ones here with addConstraints to the config. Here the max velocity/accel are applied and also the reverse flag. So you can easily change the speed which the robot runs through the specified waypoints, which is useful for testing where it is nice to set the speed slower.

edit: This is good enough for us, but would like to see a built-in case for waypoints from pathweaver or future pathing programs to make constraints easy to access.