Autonomous path following and trajectory motion profiling #roadrunner #ramsete #pathweaver #navigation - cwm9cwm9/TTGT-FTC-FRC GitHub Wiki

Critical notes:

Many advanced path-following libraries use an IMU (Inertial Measurement Init) to measure the robot's pose (that is, location) in the real world and correct the robot's trajectory. The IMU must be face-up and parallel to the ground and, if accelerometers are used in the algorithm, correctly oriented to and centered on the robot's wheel base, or the IMU will not report correct data. (With appropriate software/settings changes, the IMU can be mounted in alternate orientations.)

Preliminaries:

A path tracking and following algorithm enables a robot to travel along a predetermined path.

A trajectory motion profile algorithm also enables a robot to follow a predetermined path, but additionally controls the robots velocity and acceleration via added constraints. This has the advantage of reducing the requirement for dead wheels.

FTC lib is an add-on class library for FTC intended to clone the functionality of WPI lib, the library used in FRC. It sits on top of the FTC API and can be used side-by-side with other add-on class libraries and the rest of the FTC API library.

Road Runner is an is an add-on class library for FTC. It sits on top of the FTC API and can be used side-by-side with other add-on class libraries and the rest of the FTC API library.

Overview:

To have your robot follow a predetermined path or trajectory requires three elements:

  1. Odometry: the science of knowing where your robot is on the field over time, which may or may not involve the use of dead wheels, intertial measurement units, or other position tracking systems.
  2. A path or trajectory: A list of splines and/or lines and/or turns for the robot to follow, along with acceleration and velocity constraints in the case of trajectories.
  3. A path following algorithm or trajectory motion profiling algorithm.

Algorithms:

The three most commonly used algorithms are:

  1. Pure Pursuit (non-holonomic): a simple path following algorithm that is easy to use but has a tendency to clip corners and cannot be locally velocity or acceleration constrained. It is possible to define a path dynamically (i.e., modify the path as the path is being actively travled) using this algorithm. Pure Pursuit is available in FTC via the FTC Lib library (a clone implementation of the WPI library use in FRC). FRC teams will need to locate a suitable a 3rd party library such as PurePursuitAlgorithm (github.com).
  2. RAMSETE (both non-holonomic and holonomic versions available): an advanced non-linear path following algorithm. RAMSETE is an abbreviation for “Robotica Articolata e Mobile per i SErvizi e le TEcnologie”, a book that contained an article entitled, “Control of Wheeled Mobile Robots: An Experimental Overview” that described an algorithm that is now referred to as “the RAMSETE Algorithm,” and, DEPENDING ON THE IMPLEMENTATION, can be use with holonomic drives. It can handle acceleration and velocity constraints. A NON-HOLONOMIC version is available in WPILib and it's FTC clone, FTCLib. A HOLONOMIC version is available as an add-in library called RoadRunner for FTC. It may be possible to adapt RoadRunner for use in FRC holonomic systems.
  3. An unnamed PID-based linear holonomic algorithm available in WPILib and it's FTC clone, FTCLib.

WPI/FTC lib both offer API-based trajectory generation by combining multiple clamped cubic spline trajectory segments into a single trajectory object. They also have a complex constraint system that permits geographically localized constraints on multiple acceleration and velocity parameters (both robot and wheel-specific). Both offer a basic trajectory manipulation library to shift and re-orient existing trajectories.

WPILib additionally offers a Windows GUI program called “PathWeaver” that can be used to visualize paths used in WPILib (and probably FTClib). With manipulation, it may be possible to use the output with the RoadRunner implementation of RAMSETE.

RoadRunner uses a trajectory system that uses linked segments, where each segment is made up of either a spline, straight-line segment, or turn. Road Runner offers the ability to reverse a trajectory and has “markers”, a system that signals the rest of the robot at specific points in the trajectory to perform actions. Constraints are added as steps in the trajectory.