LinearInterpolation.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarXGuiPlugins::RobotTrajectoryDesigner::Interpolation
17 * @author Timo Birr
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22#ifndef LINEARINTERPOLATION_H
23#define LINEARINTERPOLATION_H
24
25#include <Eigen/Eigen>
26
28
29namespace armarx
30{
31 /**
32 * @brief The LinearInterpolation class represents a linear Interpolation between a series of control points
33 * Linear means that the position is calcualed by a function with the Form a + time * b (with a and b as three-dimensional Vectors)
34 */
36 {
37
38 public:
39 /**
40 * @brief LinearInterpolation creates a new LinearInterPolation defined by controlPoints
41 * @param controlPoints a vector of Poses that define the Interpolation-Function
42 */
43 LinearInterpolation(std::vector<PoseBasePtr> controlPoints);
44
45 /**
46 * @brief getPoseAt returns the Pose defined by f(time)
47 * @param time a time between 0 and 1 with getPoseAt(0) being the startingPose and getPoseAt(1) being the ending Pose
48 * @return the pose of the interpolation-function at time
49 */
50 PoseBasePtr getPoseAt(double time) override;
51
52 private:
53 std::vector<Eigen::Vector3f> connectingVector;
54 };
55
56 using LinearInterpolationPtr = std::shared_ptr<LinearInterpolation>;
57
58
59} // namespace armarx
60
61#endif
The AbstractInterpolation class represents a function f:t->P with P being the space of all poses The ...
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.
std::shared_ptr< LinearInterpolation > LinearInterpolationPtr