Motion profiling and pathfinder

I am working on using these two for next year, and was wondering if their were any code examples, and if someone could explain how exactly they get the points for autonomous down so well, and finally just explaining what it can be used for and what exactly it is.

Pathfinder is a tool that takes in waypoints (x, y, orientation), and generates a smooth curve for the robot to follow. You also provide constraints for the robot (max velocity, acceleration, and jerk) and Pathfinder returns the position, velocity, acceleration, and jerk of your robot at each timestamp.

Most teams will use this data and a simple PIDVA controller to follow the trajectory. The PID terms are used to close the loop on position error and the VA terms are used as velocity and acceleration feedforwards (using the known dynamics of your system to help you reach your goal).

Code examples for Pathfinder are on the Pathfinder GitHub page:https://github.com/JacisNonsense/Pathfinder.

To figure out the waypoints, using a graphical tool (just a visualizer of trajectories generated by Pathfinder) is often helpful. We used this tool to visualize our trajectories: https://github.com/Endoman123/motion-profile-generator/

This tool generates a CSV of the trajectory. We read and store all the trajectories in a map on robotInit and execute specific trajectories based on the field configuration and desired autonomous behavior.