Class AMotionProfile

java.lang.Object
com.stuypulse.stuylib.streams.angles.filters.AMotionProfile
All Implemented Interfaces:
AFilter

public class AMotionProfile extends Object implements AFilter
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

    • AMotionProfile

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

      public AMotionProfile(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 Angle get(Angle target)
      Description copied from interface: AFilter
      Get next value in Filter based on the next value given
      Specified by:
      get in interface AFilter
      Parameters:
      target - next input value in the stream
      Returns:
      the output value of the filter