Enum Followers

java.lang.Object
java.lang.Enum<Followers>
me.wobblyyyy.pathfinder.followers.Followers
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Followers>, java.lang.constant.Constable

public enum Followers
extends java.lang.Enum<Followers>
A collection of different types of path followers.

The pros and cons for each type of follower are listed in each of the follower's respective JavaDocs.

Since:
0.1.0
Author:
Colin Robertson
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    DUAL_PID
    A follower based on an X and Y PID controller.
    LINEAR
    Linear follower without proportion.
    PID
    Basic proportional integral derivative follower.
    PROPORTIONAL
    Linear follower with distance proportion speed.
    SWERVE
    Use JaciBrunning's Pathfinder library to generate a swerve trajectory and follow it.
    TRI_PID
    A follower based on an X, Y, and SPEED PID controller.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    private Followers()  
  • Method Summary

    Modifier and Type Method Description
    static Followers valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static Followers[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • PID

      public static final Followers PID
      Basic proportional integral derivative follower.

      PROS:

      • Fast generation, PID doesn't require much math.
      • (Usually) accurate following.
      • Linear paths are easy.

      CONS:

      • Non-linear or multi-stage paths are very slow.
      • Potential inaccuracy based on the robot's profile.

    • LINEAR

      public static final Followers LINEAR
      Linear follower without proportion.

      PROS:

      • Can't go wrong. Unless you go too fast.
      • Very fast generation - can be run whenever.

      CONS:

      • Very slow and not at all optimized.
      • Can over-shoot targets pretty easily.

    • PROPORTIONAL

      public static final Followers PROPORTIONAL
      Linear follower with distance proportion speed.

      PROS:

      • Stable and reliable.
      • Immediate generation.

      CONS:

      • Not fully optimized.
      • Can follow inaccurately.
      • Proportional curves can be difficult to tweak.

    • SWERVE

      public static final Followers SWERVE
      Use JaciBrunning's Pathfinder library to generate a swerve trajectory and follow it.

      PROS:

      • Incredibly efficient path generation.
      • Fantastic support for multi-stage paths.
      • Very, very, very fast.
      • Designed specifically for swerve drivetrains.

      CONS:

      • Path generation is VERY expensive.
      • Trajectories are also very expensive, and you need 5.

      Pathfinder can detect potential collisions that might occur based on the generated trajectory, however, doing so can be slow.

    • DUAL_PID

      public static final Followers DUAL_PID
      A follower based on an X and Y PID controller. These controllers attempt to get the X and Y positions of the robot to the target positions. This type of controller moves at a constant speed that is set upon the follower's construction.
    • TRI_PID

      public static final Followers TRI_PID
      A follower based on an X, Y, and SPEED PID controller. This type of follower is an extension of the DUAL_PID follower and seeks to optimize precise movement by using an additional PID controller to control the speed of the robot.
  • Constructor Details

    • Followers

      private Followers()
  • Method Details

    • values

      public static Followers[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Followers valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null