Class LinearInterpolatorQ


  • public class LinearInterpolatorQ
    extends InterpolatorQ
    Make a linear interpolation between to position

    Given a start \mathbf{s}, end \mathbf{e} and duration d
    the interpolation is implemented as \mathbf{x}(t)=\mathbf{s} + (\mathbf{e}-\mathbf{s})*t/d.

    The template argument given needs to support addition with the "+" operator
    and scaling with a double using the "*" operator.

    For use with a rw::math::Transform3D see the template specialization
    • Constructor Summary

      Constructors 
      Constructor Description
      LinearInterpolatorQ​(long cPtr, boolean cMemoryOwn)  
      LinearInterpolatorQ​(Q start, Q end, double duration)
      Construct LinearInterpolator starting a start and finishing in end
      and taking duration time.

      If duration <= 0 an exception is thrown

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Q ddx​(double t)
      Acceleration at time t
      void delete()  
      double duration()
      Returns the duration of the interpolator

      The duration is defined as the time it takes to move from one end
      of the interpolator to the other.
      Q dx​(double t)
      Velocity at time t
      static long getCPtr​(LinearInterpolatorQ obj)  
      Q getEnd()
      Returns the end position of the interpolator
      Q getStart()
      Returns the start position of the interpolator
      Q x​(double t)
      Position at time t
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LinearInterpolatorQ

        public LinearInterpolatorQ​(long cPtr,
                                   boolean cMemoryOwn)
      • LinearInterpolatorQ

        public LinearInterpolatorQ​(Q start,
                                   Q end,
                                   double duration)
        Construct LinearInterpolator starting a start and finishing in end
        and taking duration time.

        If duration <= 0 an exception is thrown

        Parameters:
        start - [in] Start of interpolator
        end - [in] End of interpolator
        duration - [in] Time it takes to from one end to the other.
    • Method Detail

      • x

        public Q x​(double t)
        Description copied from class: InterpolatorQ
        Position at time t
        Overrides:
        x in class InterpolatorQ
        Parameters:
        t - [in] time between 0 and length
        Returns:
        Position
      • dx

        public Q dx​(double t)
        Description copied from class: InterpolatorQ
        Velocity at time t
        Overrides:
        dx in class InterpolatorQ
        Parameters:
        t - [in] time between 0 and length
        Returns:
        Velocity
      • ddx

        public Q ddx​(double t)
        Description copied from class: InterpolatorQ
        Acceleration at time t
        Overrides:
        ddx in class InterpolatorQ
        Parameters:
        t - [in] time between 0 and length
        Returns:
        Acceleration
      • getStart

        public Q getStart()
        Returns the start position of the interpolator
        Returns:
        The start position of the interpolator
      • getEnd

        public Q getEnd()
        Returns the end position of the interpolator
        Returns:
        The end position of the interpolator
      • duration

        public double duration()
        Description copied from class: InterpolatorQ
        Returns the duration of the interpolator

        The duration is defined as the time it takes to move from one end
        of the interpolator to the other.
        Overrides:
        duration in class InterpolatorQ
        Returns:
        duration