Class VMotionProfile

java.lang.Object
com.stuypulse.stuylib.streams.vectors.filters.VMotionProfile
All Implemented Interfaces:
VFilter

public class VMotionProfile extends Object implements VFilter
A filter, that when applied to the input of a motor, will profile it. Similar to the way in which motion profiling can limit the amount of acceleration and jerk in an S-Curve, this can do that to real time input. Because this will add a delay, it is recommended that the accelLimit is as high as possible. Aside from the accelLimit, this is identical to a SlewRateLimiter or TimedRateLimit.
  • Constructor Details

    • VMotionProfile

      public VMotionProfile(Number velLimit, Number accelLimit, int steps)
      Parameters:
      velLimit - maximum change in displacement per second (u/s)
      accelLimit - maximum change in velocity per second (u/s/s)
      steps - number of times to apply filter (improves accuracy)
    • VMotionProfile

      public VMotionProfile(Number velLimit, Number accelLimit)
      Parameters:
      velLimit - maximum change in velocity per second (u/s)
      accelLimit - maximum change in acceleration per second (u/s/s)
  • Method Details

    • get

      public Vector2D get(Vector2D target)
      Description copied from interface: VFilter
      Get next value in Filter based on the next value given
      Specified by:
      get in interface VFilter
      Parameters:
      target - next input value in the stream
      Returns:
      the output value of the filter