gsplines_cpp
gsplines_cpp copied to clipboard
Identify how to define complex functions of GSplines and its derivatives
Motivation, Approximation with GSplines
Let be an interval,
be a function and let
be the set of piecewise polynomials of degree
with
pieces.
Theorem For every there exists an
and map
such that
Theorem For every there exists an
and map
such that if
Definitions
- We call
the polynomial approximation of
- We call
the finite-dimensional approximation of
Remark Let . Then we can define
-
The polynomial approximation of the restriction of
to the polynomials
-
The finite-dimensional approximation of the restriction of
to the polynomials
Requirement: We need a class that can represent arbitrary functions an its derivative
Derivative
Integral
Direct kinematics
Here we need to represent a manifold (quaternions, euler angles. etc)
Arc lent of the direct kinematics
How we want to use this representation: We want to build new functionals from old ones
- Gspline to Gspline functional a simple function that we cal call as
GSpline torque = NewtonEuler::evaluate(q);
GSplineFunctional diff = NewtonEuler::evaluate(q);
GSpline pose = DirectKinematic::evaluate(q);
class ArcLen: public Functinal{
public:
ArcLen(GSplineSet);/*Domain, codom dim, number of intervals, interval width*/
ReturnType_1 value(const GSpline &_in) const{
return _in | gspline_set_.derivative | gspline_set_.norm | gspline_set_.integral;
}
ReturnType_2 diff(const GSpline &_in){
return gspline_set_.integral / gspline_set.norm(_in | derivative) * derivative
}
};
Remarks
- In the above example we desire to have a
ReturnType_1
which can behave as both, a vector and aGSpline
.- Cast from GSpline to Vector: This is not simple, because a gspline is constituted by two vectors. We can return the vector that represent a GSpline as an element of a vector space
GSpline::get_coefficients
. - Cast Vector to GSpline, from where we take the intervals?: This is impossible without adding more data structures.
- Cast from GSpline to Vector: This is not simple, because a gspline is constituted by two vectors. We can return the vector that represent a GSpline as an element of a vector space
- In the above example we desire to have a
ReturnType_2
which can behave as both, a matrix and aFunctional
.- this is done here
- This case is simpler, because
ReturnType_2
does not need explicitly the interval lenghts because we don't have to cast it into aGSpline