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