41 for (
unsigned int i = 0; i < this->controlPoints.size() - 1; i++)
43 PoseBasePtr current = this->controlPoints.at(i);
44 PoseBasePtr next = this->controlPoints.at(i + 1);
45 int deltaX = next->position->x - current->position->x;
46 int deltaY = next->position->y - current->position->y;
47 int deltaZ = next->position->z - current->position->z;
48 connectingVector.push_back(*
new Eigen::Vector3f(deltaX, deltaY, deltaZ));
55 if (time < 0 || time > 1)
65 double segmentRelativeTime =
69 Eigen::Vector3f start =
70 Eigen::Vector3f(current->position->x, current->position->y, current->position->z);
71 Eigen::Vector3f transition = connectingVector[segment];
72 transition *= segmentRelativeTime;
73 Eigen::Vector3f position = start + transition;
74 return *
new PoseBasePtr(
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
PoseBasePtr getPoseAt(double time) override
getPoseAt returns the Pose defined by f(time)
LinearInterpolation(std::vector< PoseBasePtr > controlPoints)
LinearInterpolation creates a new LinearInterPolation defined by controlPoints.
This file offers overloads of toIce() and fromIce() functions for STL container types.