Curves
A library for curves generation.
curves::SE3CompositionCurve< C1, C2 > Class Template Reference

#include <SE3CompositionCurve.hpp>

Inheritance diagram for curves::SE3CompositionCurve< C1, C2 >:
Inheritance graph

Public Types

typedef SE3Curve::ValueType ValueType
 
typedef SE3Curve::DerivativeType DerivativeType
 
- Public Types inherited from curves::SE3Curve
typedef Curve< SE3ConfigParent
 
typedef Parent::ValueType ValueType
 
typedef Parent::DerivativeType DerivativeType
 
- Public Types inherited from curves::Curve< SE3Config >
typedef SE3Config::ValueType ValueType
 The value type of the curve. More...
 
typedef SE3Config::DerivativeType DerivativeType
 The curve's derivative type. More...
 

Public Member Functions

 SE3CompositionCurve ()
 
 ~SE3CompositionCurve ()
 
virtual void print (const std::string &str="") const
 Print the value of the base and corrections curves coefficients. More...
 
void saveCurves (const std::string &filename) const
 Save curves data as .csv file. More...
 
virtual Time getMinTime () const
 Returns the first valid time for the curve. More...
 
virtual Time getMaxTime () const
 Returns the last valid time for the curve. More...
 
bool isEmpty () const
 Checks if the curve is empty. More...
 
int size () const
 Returns the number of coefficients in the correction curve. More...
 
int baseSize () const
 Returns the number of coefficients in the base curve. More...
 
int correctionSize () const
 Returns the number of coefficients in the correction curve. More...
 
virtual void extend (const std::vector< Time > &times, const std::vector< ValueType > &values, std::vector< Key > *outKeys=NULL)
 Extend the curve so that it can be evaluated at these times by using a default correction sampling policy. More...
 
void setMinSamplingPeriod (const Time minSamplingPeriod)
 Set the minimum sampling period for the correction curve. Overloads the function defined in SE3Curve base class. More...
 
void setSamplingRatio (const int ratio)
 Set the sampling ratio for the correction curve. eg. 4 will add a coefficient every 4 extend. More...
 
void foldInCorrections ()
 Fold in the correction curve into the base curve and reinitialize correction curve coefficients to identity transformations. More...
 
virtual void fitCurve (const std::vector< Time > &times, const std::vector< ValueType > &values, std::vector< Key > *outKeys=NULL)
 Fit a new curve to these data points. More...
 
void setCorrectionTimes (const std::vector< Time > &times)
 Add coefficients to the correction curve at given times. More...
 
virtual ValueType evaluate (Time time) const
 Evaluate the ambient space of the curve. More...
 
virtual DerivativeType evaluateDerivative (Time time, unsigned derivativeOrder) const
 
virtual void setTimeRange (Time minTime, Time maxTime)
 
virtual Eigen::Vector3d evaluateAngularVelocityA (Time time)
 Evaluate the angular velocity of Frame b as seen from Frame a, expressed in Frame a. More...
 
virtual Eigen::Vector3d evaluateAngularVelocityB (Time time)
 Evaluate the angular velocity of Frame a as seen from Frame b, expressed in Frame b. More...
 
virtual Eigen::Vector3d evaluateLinearVelocityA (Time time)
 Evaluate the velocity of Frame b as seen from Frame a, expressed in Frame a. More...
 
virtual Eigen::Vector3d evaluateLinearVelocityB (Time time)
 Evaluate the velocity of Frame a as seen from Frame b, expressed in Frame b. More...
 
virtual Vector6d evaluateTwistA (Time time)
 evaluate the velocity/angular velocity of Frame b as seen from Frame a, expressed in Frame a. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5). More...
 
virtual Vector6d evaluateTwistB (Time time)
 evaluate the velocity/angular velocity of Frame a as seen from Frame b, expressed in Frame b. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5). More...
 
virtual Eigen::Vector3d evaluateAngularDerivativeA (unsigned derivativeOrder, Time time)
 Evaluate the angular derivative of Frame b as seen from Frame a, expressed in Frame a. More...
 
virtual Eigen::Vector3d evaluateAngularDerivativeB (unsigned derivativeOrder, Time time)
 Evaluate the angular derivative of Frame a as seen from Frame b, expressed in Frame b. More...
 
virtual Eigen::Vector3d evaluateLinearDerivativeA (unsigned derivativeOrder, Time time)
 Evaluate the derivative of Frame b as seen from Frame a, expressed in Frame a. More...
 
virtual Eigen::Vector3d evaluateLinearDerivativeB (unsigned derivativeOrder, Time time)
 Evaluate the derivative of Frame a as seen from Frame b, expressed in Frame b. More...
 
virtual Vector6d evaluateDerivativeA (unsigned derivativeOrder, Time time)
 evaluate the velocity/angular derivative of Frame b as seen from Frame a, expressed in Frame a. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5). More...
 
virtual Vector6d evaluateDerivativeB (unsigned derivativeOrder, Time time)
 evaluate the velocity/angular velocity of Frame a as seen from Frame b, expressed in Frame b. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5). More...
 
virtual void clear ()
 Clear the base and correction curves. More...
 
void removeCorrectionCoefficientAtTime (Time time)
 Remove a correction coefficient at the specified time. More...
 
void setCorrectionCoefficientAtTime (Time time, ValueType value)
 Set the correction coefficient value at the specified time. More...
 
void transformCurve (const ValueType T)
 Perform a rigid transformation on the left side of the curve. More...
 
void resetCorrectionCurve (const std::vector< Time > &times)
 Reset the correction curve to identity values with knots at desired times. More...
 
void setBaseCurve (const std::vector< Time > &times, const std::vector< ValueType > &values)
 Set the base curve to given values with knots at desired times Resets the curve beforehand. More...
 
void setBaseCurvePart (const std::vector< Time > &times, const std::vector< ValueType > &values)
 Add / replace the given coefficients without resetting the curve. More...
 
void modifyBaseCoefficientsValuesInBatch (const std::vector< Time > &times, const std::vector< ValueType > &values)
 Modifies values of the base coefficient in batch, starting at times[0] and assuming that a coefficient exists at all the specified times. More...
 
void saveCurveTimesAndValues (const std::string &filename) const
 Save the base curve times and composed curve values. More...
 
void saveCurveAtTimes (const std::string &filename, std::vector< Time > times) const
 
void saveCorrectionCurveAtTimes (const std::string &filename, std::vector< Time > times) const
 
void saveCorrectionCurveTimesAndValues (const std::string &filename) const
 
void getBaseCurveTimes (std::vector< Time > *outTimes) const
 
void getBaseCurveTimesInWindow (std::vector< Time > *outTimes, Time begTime, Time endTime) const
 
void getCurveTimes (std::vector< Time > *outTimes) const
 
- Public Member Functions inherited from curves::SE3Curve
 SE3Curve ()
 
virtual ~SE3Curve ()
 
virtual void transformCurve (const ValueType T)=0
 Perform a rigid transformation on the left side of the curve. More...
 
virtual void setCorrectionCoefficientAtTime (Time time, ValueType value)=0
 Set the correction coefficient value at the specified time. More...
 
virtual void setBaseCurve (const std::vector< Time > &times, const std::vector< ValueType > &values)=0
 Set the base curve to given values with knots at desired times Resets the curve beforehand. More...
 
virtual void setBaseCurvePart (const std::vector< Time > &times, const std::vector< ValueType > &values)=0
 Add / replace the given coefficients without resetting the curve. More...
 
virtual void modifyBaseCoefficientsValuesInBatch (const std::vector< Time > &times, const std::vector< ValueType > &values)=0
 Modifies values of the base coefficient in batch, starting at times[0] and assuming that a coefficient exists at all the specified times. More...
 
- Public Member Functions inherited from curves::Curve< SE3Config >
 Curve ()
 
virtual ~Curve ()
 
virtual bool evaluate (ValueType &value, Time time) const =0
 Evaluate the ambient space of the curve. More...
 
virtual bool evaluateDerivative (DerivativeType &derivative, Time time, unsigned derivativeOrder) const =0
 

Private Attributes

C1 baseCurve_
 
C2 correctionCurve_
 

Detailed Description

template<class C1, class C2>
class curves::SE3CompositionCurve< C1, C2 >

Definition at line 19 of file SE3CompositionCurve.hpp.

Member Typedef Documentation

template<class C1, class C2>
typedef SE3Curve::DerivativeType curves::SE3CompositionCurve< C1, C2 >::DerivativeType

Definition at line 27 of file SE3CompositionCurve.hpp.

template<class C1, class C2>
typedef SE3Curve::ValueType curves::SE3CompositionCurve< C1, C2 >::ValueType

Definition at line 26 of file SE3CompositionCurve.hpp.

Constructor & Destructor Documentation

template<class C1 , class C2 >
curves::SE3CompositionCurve< C1, C2 >::SE3CompositionCurve ( )

Definition at line 22 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
curves::SE3CompositionCurve< C1, C2 >::~SE3CompositionCurve ( )

Definition at line 27 of file SE3CompositionCurve-inl.hpp.

Member Function Documentation

template<class C1 , class C2 >
int curves::SE3CompositionCurve< C1, C2 >::baseSize ( ) const
virtual

Returns the number of coefficients in the base curve.

Implements curves::SE3Curve.

Definition at line 100 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::clear ( )
virtual

Clear the base and correction curves.

Implements curves::SE3Curve.

Definition at line 350 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
int curves::SE3CompositionCurve< C1, C2 >::correctionSize ( ) const
virtual

Returns the number of coefficients in the correction curve.

Implements curves::SE3Curve.

Definition at line 105 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
SE3CompositionCurve< C1, C2 >::ValueType curves::SE3CompositionCurve< C1, C2 >::evaluate ( Time  time) const
virtual

Evaluate the ambient space of the curve.

Definition at line 226 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateAngularDerivativeA ( unsigned  derivativeOrder,
Time  time 
)
virtual

Evaluate the angular derivative of Frame b as seen from Frame a, expressed in Frame a.

Implements curves::SE3Curve.

Definition at line 320 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateAngularDerivativeB ( unsigned  derivativeOrder,
Time  time 
)
virtual

Evaluate the angular derivative of Frame a as seen from Frame b, expressed in Frame b.

Implements curves::SE3Curve.

Definition at line 325 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateAngularVelocityA ( Time  time)
virtual

Evaluate the angular velocity of Frame b as seen from Frame a, expressed in Frame a.

Implements curves::SE3Curve.

Definition at line 290 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateAngularVelocityB ( Time  time)
virtual

Evaluate the angular velocity of Frame a as seen from Frame b, expressed in Frame b.

Implements curves::SE3Curve.

Definition at line 295 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
SE3CompositionCurve< C1, C2 >::DerivativeType curves::SE3CompositionCurve< C1, C2 >::evaluateDerivative ( Time  time,
unsigned  derivativeOrder 
) const
virtual

Evaluate the curve derivatives. linear 1st derivative has following behaviour:

  • time is out of bound –> error
  • time is between 2 coefficients –> take slope between the 2 coefficients
  • time is on coefficient (not last coefficient) –> take slope between coefficient and next coefficients
  • time is on last coefficient –> take slope between last-1 and last coefficient derivatives of order >1 equal 0

Definition at line 279 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Vector6d curves::SE3CompositionCurve< C1, C2 >::evaluateDerivativeA ( unsigned  derivativeOrder,
Time  time 
)
virtual

evaluate the velocity/angular derivative of Frame b as seen from Frame a, expressed in Frame a. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5).

Implements curves::SE3Curve.

Definition at line 340 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Vector6d curves::SE3CompositionCurve< C1, C2 >::evaluateDerivativeB ( unsigned  derivativeOrder,
Time  time 
)
virtual

evaluate the velocity/angular velocity of Frame a as seen from Frame b, expressed in Frame b. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5).

Implements curves::SE3Curve.

Definition at line 345 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateLinearDerivativeA ( unsigned  derivativeOrder,
Time  time 
)
virtual

Evaluate the derivative of Frame b as seen from Frame a, expressed in Frame a.

Implements curves::SE3Curve.

Definition at line 330 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateLinearDerivativeB ( unsigned  derivativeOrder,
Time  time 
)
virtual

Evaluate the derivative of Frame a as seen from Frame b, expressed in Frame b.

Implements curves::SE3Curve.

Definition at line 335 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateLinearVelocityA ( Time  time)
virtual

Evaluate the velocity of Frame b as seen from Frame a, expressed in Frame a.

Implements curves::SE3Curve.

Definition at line 300 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Eigen::Vector3d curves::SE3CompositionCurve< C1, C2 >::evaluateLinearVelocityB ( Time  time)
virtual

Evaluate the velocity of Frame a as seen from Frame b, expressed in Frame b.

Implements curves::SE3Curve.

Definition at line 305 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Vector6d curves::SE3CompositionCurve< C1, C2 >::evaluateTwistA ( Time  time)
virtual

evaluate the velocity/angular velocity of Frame b as seen from Frame a, expressed in Frame a. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5).

Implements curves::SE3Curve.

Definition at line 310 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Vector6d curves::SE3CompositionCurve< C1, C2 >::evaluateTwistB ( Time  time)
virtual

evaluate the velocity/angular velocity of Frame a as seen from Frame b, expressed in Frame b. The return value has the linear velocity (0,1,2), and the angular velocity (3,4,5).

Implements curves::SE3Curve.

Definition at line 315 of file SE3CompositionCurve-inl.hpp.

template<class C1, class C2>
void curves::SE3CompositionCurve< C1, C2 >::extend ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values,
std::vector< Key > *  outKeys = NULL 
)
virtual

Extend the curve so that it can be evaluated at these times by using a default correction sampling policy.

Implements curves::Curve< SE3Config >.

Definition at line 122 of file SE3CompositionCurve-inl.hpp.

template<class C1, class C2>
void curves::SE3CompositionCurve< C1, C2 >::fitCurve ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values,
std::vector< Key > *  outKeys = NULL 
)
virtual

Fit a new curve to these data points.

The existing curve will be cleared. Underneath the curve should have some default policy for fitting.

Implements curves::Curve< SE3Config >.

Definition at line 203 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::foldInCorrections ( )
virtual

Fold in the correction curve into the base curve and reinitialize correction curve coefficients to identity transformations.

Implements curves::SE3Curve.

Definition at line 182 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::getBaseCurveTimes ( std::vector< Time > *  outTimes) const
virtual

Implements curves::SE3Curve.

Definition at line 457 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::getBaseCurveTimesInWindow ( std::vector< Time > *  outTimes,
Time  begTime,
Time  endTime 
) const
virtual

Implements curves::SE3Curve.

Definition at line 462 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::getCurveTimes ( std::vector< Time > *  outTimes) const
virtual

Implements curves::SE3Curve.

Definition at line 468 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Time curves::SE3CompositionCurve< C1, C2 >::getMaxTime ( ) const
virtual

Returns the last valid time for the curve.

Implements curves::Curve< SE3Config >.

Definition at line 84 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
Time curves::SE3CompositionCurve< C1, C2 >::getMinTime ( ) const
virtual

Returns the first valid time for the curve.

Implements curves::Curve< SE3Config >.

Definition at line 79 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
bool curves::SE3CompositionCurve< C1, C2 >::isEmpty ( ) const
virtual

Checks if the curve is empty.

Implements curves::SE3Curve.

Definition at line 89 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::modifyBaseCoefficientsValuesInBatch ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)

Modifies values of the base coefficient in batch, starting at times[0] and assuming that a coefficient exists at all the specified times.

Definition at line 402 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::print ( const std::string &  str = "") const
virtual

Print the value of the base and corrections curves coefficients.

Implements curves::Curve< SE3Config >.

Definition at line 31 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::removeCorrectionCoefficientAtTime ( Time  time)
virtual

Remove a correction coefficient at the specified time.

Implements curves::SE3Curve.

Definition at line 356 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::resetCorrectionCurve ( const std::vector< Time > &  times)
virtual

Reset the correction curve to identity values with knots at desired times.

Implements curves::SE3Curve.

Definition at line 374 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::saveCorrectionCurveAtTimes ( const std::string &  filename,
std::vector< Time times 
) const
virtual

Implements curves::SE3Curve.

Definition at line 441 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::saveCorrectionCurveTimesAndValues ( const std::string &  filename) const
virtual

Implements curves::SE3Curve.

Definition at line 433 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::saveCurveAtTimes ( const std::string &  filename,
std::vector< Time times 
) const
virtual

Implements curves::SE3Curve.

Definition at line 417 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::saveCurves ( const std::string &  filename) const

Save curves data as .csv file.

Definition at line 40 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::saveCurveTimesAndValues ( const std::string &  filename) const
virtual

Save the base curve times and composed curve values.

Implements curves::SE3Curve.

Definition at line 409 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setBaseCurve ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)

Set the base curve to given values with knots at desired times Resets the curve beforehand.

Definition at line 388 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setBaseCurvePart ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)

Add / replace the given coefficients without resetting the curve.

Definition at line 395 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setCorrectionCoefficientAtTime ( Time  time,
ValueType  value 
)

Set the correction coefficient value at the specified time.

Definition at line 361 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setCorrectionTimes ( const std::vector< Time > &  times)
virtual

Add coefficients to the correction curve at given times.

Implements curves::SE3Curve.

Definition at line 210 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setMinSamplingPeriod ( const Time  minSamplingPeriod)
virtual

Set the minimum sampling period for the correction curve. Overloads the function defined in SE3Curve base class.

Implements curves::SE3Curve.

Definition at line 110 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setSamplingRatio ( const int  ratio)
virtual

Set the sampling ratio for the correction curve. eg. 4 will add a coefficient every 4 extend.

Implements curves::SE3Curve.

Definition at line 116 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::setTimeRange ( Time  minTime,
Time  maxTime 
)
virtual

Definition at line 285 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
int curves::SE3CompositionCurve< C1, C2 >::size ( ) const
virtual

Returns the number of coefficients in the correction curve.

Implements curves::SE3Curve.

Definition at line 94 of file SE3CompositionCurve-inl.hpp.

template<class C1 , class C2 >
void curves::SE3CompositionCurve< C1, C2 >::transformCurve ( const ValueType  T)
virtual

Perform a rigid transformation on the left side of the curve.

Implements curves::Curve< SE3Config >.

Definition at line 367 of file SE3CompositionCurve-inl.hpp.

Member Data Documentation

template<class C1, class C2>
C1 curves::SE3CompositionCurve< C1, C2 >::baseCurve_
private

Definition at line 22 of file SE3CompositionCurve.hpp.

template<class C1, class C2>
C2 curves::SE3CompositionCurve< C1, C2 >::correctionCurve_
private

Definition at line 23 of file SE3CompositionCurve.hpp.


The documentation for this class was generated from the following files: