FollowerGenerator
A functional interface used for generating followers. Pathfinder's movement is controlled via an executor manager, which, in turn, controls several follower executors. Each of these follower executors executes a set of followers. Each of these followers instructs the robot on how to follow a certain trajectory.
Pathfinder can be commanded to follow a path using some of the methods available in the Voyager class. However, Pathfinder can only actually interpret followers - not just trajectories. A FollowerGenerator provides a way for Pathfinder to interpret trajectories as followers, and thus, interpret trajectories and move the robot accordingly.
Included in the "see" tag of this class JavaDoc is a link to the "generic follower generator." This is the simplest (and probably best) option when it comes to generating followers. Instead of creating your own method of creating new followers, the generic follower generator will produce generic followers - pretty simple, right? Unless you have a very specific use case, generic followers should work more than well enough.
Methods
generate(Robot robot, Trajectory trajectory)
Generates a new Follower based on the provided Robot and Trajectory.
robot: TheRobotinstance that this follower will act upon. This robot should be capable of providing positioning using theRobot.odometry()method, as well as providing movement options with theRobot.drive()method.trajectory: TheTrajectorythat this follower should be following. EachFollowershould be responsible for one singleTrajectory, so aFollowerwill be created for thisTrajectory.
Returns a newly-generated Follower responsible for the execution of the inputted trajectory.