RobWorkProject
24.12.4-
|
Make a linear interpolation between to position. More...
#include <LinearInterpolator.hpp>
Inherits Interpolator< T >.
Public Types | |
typedef rw::core::Ptr< LinearInterpolator > | Ptr |
smart pointer type to instance of class | |
typedef rw::core::Ptr< const LinearInterpolator > | CPtr |
smart pointer type const instance of class | |
Public Types inherited from Interpolator< T > | |
typedef rw::core::Ptr< Interpolator > | Ptr |
smart pointer type to this class | |
Public Member Functions | |
LinearInterpolator (const T &start, const T &end, double duration) | |
Construct LinearInterpolator starting a start and finishing in end and taking duration time. More... | |
T | x (double t) const |
Position at time t. More... | |
T | dx (double t) const |
Velocity at time t. More... | |
T | ddx (double t) const |
Acceleration at time t. More... | |
T | getStart () const |
Returns the start position of the interpolator. More... | |
T | getEnd () const |
Returns the end position of the interpolator. More... | |
double | duration () const |
Returns the duration of the interpolator. More... | |
Public Member Functions inherited from Interpolator< T > | |
virtual | ~Interpolator () |
Virtual destructor. | |
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
|
inline |
Construct LinearInterpolator starting a start and finishing in end and taking duration time.
If duration <= 0 an exception is thrown
start | [in] Start of interpolator |
end | [in] End of interpolator |
duration | [in] Time it takes to from one end to the other. |
|
inlinevirtual |
Acceleration at time t.
t | [in] time between 0 and length |
Implements Interpolator< T >.
|
inlinevirtual |
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.
Implements Interpolator< T >.
|
inlinevirtual |
Velocity at time t.
t | [in] time between 0 and length |
Implements Interpolator< T >.
|
inline |
Returns the end position of the interpolator.
|
inline |
Returns the start position of the interpolator.
|
inlinevirtual |
Position at time t.
t | [in] time between 0 and length |
Implements Interpolator< T >.