Class InterpolatorTrajectoryQuaternion_f


  • public class InterpolatorTrajectoryQuaternion_f
    extends TrajectoryQuaternion_f
    Sequence of interpolators and blends giving a trajectory

    A trajectory is defined as a sequence of interpolators and blends.
    Multiple interpolators can follow each other, whereas a Blend must be
    preceded and followed by interpolators.

    The length of a Trajectory is defined as the time it takes to go from
    start to finish.

    When performing random queries the trajectory needs to do a binary search
    through all interpolators and blend, giving the random access an O(lg n)
    complexity.

    For accessing multiple consecutive values use TrajectoryInterpolator.

    Example of usage:
    Transform3D<> T1(Vector3D<>(0,0,0), EAA<>(0,0,0)); Transform3D<> T2(Vector3D<>(1,1,0), EAA<>(1,1,0)); Transform3D<> T3(Vector3D<>(2,0,0), EAA<>(2,2,0)); LinearInterpolator<Transform3D<> >::Ptr cartInt1 = ownedPtr(new LinearInterpolator<Transform3D<> >(T1, T2, 1)); LinearInterpolator<Transform3D<> >::Ptr cartInt2 = ownedPtr(new LinearInterpolator<Transform3D<> >(T2, T3, 1)); ParabolicBlend<Transform3D<> >::Ptr blend1 = ownedPtr(new ParabolicBlend<Transform3D<> >(cartInt1, cartInt2, 0.25)); InterpolatorTrajectory<Transform3D<> > trajectory; trajectory.add(cartInt1); trajectory.add(blend1, cartInt2); std::ofstream out("test.dat"); for (double t = 0; t<=trajectory.duration(); t += dt) { Transform3D<> x = trajectory.x(t); out<<t<<" "<<x.P()(0)<<" "<<x.P()(1)<<" "<<x.P()(2)<<std::endl; } out.close();