33using namespace alglib;
44 alglib::pspline2build(getCoordinateArray(0),
controlPoints.size(), 2, 0, xInterpolation);
45 alglib::pspline2build(getCoordinateArray(1),
controlPoints.size(), 2, 0, yInterpolation);
46 alglib::pspline2build(getCoordinateArray(2),
controlPoints.size(), 2, 0, zInterpolation);
52 if (time < 0 || time > 1)
64 alglib::pspline2calc(xInterpolation, time,
x, temp);
65 alglib::pspline2calc(yInterpolation, time, y, temp);
66 alglib::pspline2calc(zInterpolation, time, z, temp);
68 Vector3BasePtr position =
new Vector3(
x, y, z);
70 return *
new PoseBasePtr(
new Pose(position, base));
97SplineInterpolation::getCoordinateArray(
int coordinate)
99 std::string transformation =
"[";
107 temp = current->position->x;
110 temp = current->position->y;
113 temp = current->position->z;
116 transformation = transformation +
"[" + std::to_string(temp) +
"," +
117 std::to_string(i / this->controlPoints.size()) +
"]";
120 transformation +=
",";
124 transformation +=
"]";
125 const char*
c = transformation.c_str();
126 real_2d_array input = *
new real_2d_array(
c);
virtual const QuaternionBasePtr calculateOrientationAt(double time)
calculateOrientationAt calculates the rotation/orientation of the pose at a certain time
static PoseBasePtr deepCopy(PoseBasePtr org)
deepCopy creates a real, independent copy of a PoseBasePtr
void init(const std::vector< PoseBasePtr > cp)
init convinience method to construct the basic parts of the interpolation (copying all controlPoints)
std::vector< PoseBasePtr > controlPoints
controlPoints the controlPoints that are interpolated between
The SplineInterpolationSegment class represents the segment of a parent SplineInterpolation between t...
AbstractInterpolationPtr getInterPolationSegment(PoseBasePtr start)
getInterPolationSegment returns a segment of the current interpolation
PoseBasePtr getPoseAt(double time) override
getPoseAt returns the Pose defined by f(time)
SplineInterpolation(std::vector< PoseBasePtr > controlPoints)
SplineInterpolation creates a new SplineInterpolation through a series of conntrol points.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< AbstractInterpolation > AbstractInterpolationPtr