SplineInterpolation.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 SPLINEINTERPOLATION_H
23 #define SPLINEINTERPOLATION_H
24 
25 #include "AbstractInterpolation.h"
26 
27 #include <interpolation.h>
28 
29 
30 namespace armarx
31 {
32  /**
33  * @brief The SplineInterpolation class represents a linear Interpolation between a series of control points
34  * Spline means that the position is calcualed by a function with the form of the ploynom
35  */
37  {
38  public:
39  /**
40  * @brief SplineInterpolation creates a new SplineInterpolation through a series of conntrol points
41  * @param controlPoints a vector of Poses that define the Interpolation-Function
42  */
43  SplineInterpolation(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  /**
53  * @brief getInterPolationSegment returns a segment of the current interpolation
54  * @param start the Pose where the Interval of the InterpolationSegment starts
55  * @return the shared_ptr to an interpolation Function that is a scaled Interval of this Interpolation
56  */
58 
59  /**
60  * @brief getInterPolationSegment returns a segment of the current interpolation
61  * @param start the Pose where the Interval of the InterpolationSegment starts
62  * @return the shared_ptr to an interpolation Function that is a scaled Interval of this Interpolation
63  */
65 
66  private:
67  alglib::real_2d_array getCoordinateArray(int coordinate);
68 
69  alglib::pspline2interpolant xInterpolation;
70  alglib::pspline2interpolant yInterpolation;
71  alglib::pspline2interpolant zInterpolation;
72 
73  };
74 
75  using SplineInterpolationPtr = std::shared_ptr<SplineInterpolation>;
76 }
77 
78 #endif
armarx::SplineInterpolation::getInterPolationSegment
AbstractInterpolationPtr getInterPolationSegment(PoseBasePtr start)
getInterPolationSegment returns a segment of the current interpolation
Definition: SplineInterpolation.cpp:71
armarx::SplineInterpolation::getPoseAt
PoseBasePtr getPoseAt(double time) override
getPoseAt returns the Pose defined by f(time)
Definition: SplineInterpolation.cpp:47
AbstractInterpolation.h
armarx::AbstractInterpolation
The AbstractInterpolation class represents a function f:t->P with P being the space of all poses The ...
Definition: AbstractInterpolation.h:36
armarx::AbstractInterpolationPtr
std::shared_ptr< AbstractInterpolation > AbstractInterpolationPtr
Definition: AbstractInterpolation.h:77
armarx::SplineInterpolationPtr
std::shared_ptr< SplineInterpolation > SplineInterpolationPtr
Definition: SplineInterpolation.h:75
armarx::SplineInterpolation::SplineInterpolation
SplineInterpolation(std::vector< PoseBasePtr > controlPoints)
SplineInterpolation creates a new SplineInterpolation through a series of conntrol points.
Definition: SplineInterpolation.cpp:34
armarx::AbstractInterpolation::controlPoints
std::vector< PoseBasePtr > controlPoints
controlPoints the controlPoints that are interpolated between
Definition: AbstractInterpolation.h:57
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::SplineInterpolation
The SplineInterpolation class represents a linear Interpolation between a series of control points Sp...
Definition: SplineInterpolation.h:36