Curves
A library for curves generation.
curves::SlerpSE3Curve Class Reference

#include <SlerpSE3Curve.hpp>

Inheritance diagram for curves::SlerpSE3Curve:
Inheritance graph

Public Types

typedef SE3Curve::ValueType ValueType
 
typedef SE3Curve::DerivativeType DerivativeType
 
typedef ValueType Coefficient
 
typedef LocalSupport2CoefficientManager< Coefficient >::TimeToKeyCoefficientMap TimeToKeyCoefficientMap
 
typedef LocalSupport2CoefficientManager< Coefficient >::CoefficientIter CoefficientIter
 
- 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

 SlerpSE3Curve ()
 
virtual ~SlerpSE3Curve ()
 
virtual void print (const std::string &str="") const
 Print the value of the coefficient, for debugging and unit tests. More...
 
virtual Time getMinTime () const
 The first valid time for the curve. More...
 
virtual Time getMaxTime () const
 The one past the last valid time for the curve. More...
 
bool isEmpty () const
 
int size () const
 
virtual void extend (const std::vector< Time > &times, const std::vector< ValueType > &values, std::vector< Key > *outKeys=NULL)
 
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 setCurve (const std::vector< Time > &times, const std::vector< ValueType > &values)
 Set some coefficients of the curve The existing curve will NOT be cleared. 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...
 
void setMinSamplingPeriod (Time time)
 set the minimum sampling period More...
 
void setSamplingRatio (const int ratio)
 Set the sampling ratio. eg. 4 will add a coefficient every 4 extend. More...
 
virtual void clear ()
 Clear all the curve coefficients. More...
 
void transformCurve (const ValueType T)
 Perform a rigid transformation on the left side of the curve. More...
 
void saveCurveTimesAndValues (const std::string &filename) const
 
void saveCurveAtTimes (const std::string &filename, std::vector< Time > times) const
 
void saveCorrectionCurveAtTimes (const std::string &filename, std::vector< Time > times) const
 
void getCurveTimes (std::vector< Time > *outTimes) const
 
int correctionSize () const
 Returns the number of coefficients in the correction curve. More...
 
void foldInCorrections ()
 Fold in the correction curve into the base curve and reinitialize correction curve coefficients to identity transformations. More...
 
void setCorrectionTimes (const std::vector< Time > &times)
 Add coefficients to the correction curve at given times. 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 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 getBaseCurveTimes (std::vector< Time > *outTimes) const
 
void getBaseCurveTimesInWindow (std::vector< Time > *outTimes, Time begTime, Time endTime) const
 
int baseSize () const
 
void saveCorrectionCurveTimesAndValues (const std::string &filename) 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

LocalSupport2CoefficientManager< Coefficientmanager_
 
SamplingPolicy slerpPolicy_
 

Friends

class SE3CompositionCurve< SlerpSE3Curve, SlerpSE3Curve >
 
class SE3CompositionCurve< SlerpSE3Curve, CubicHermiteSE3Curve >
 
class SamplingPolicy
 

Detailed Description

Implements the Slerp (Spherical linear interpolation) curve class. The Slerp interpolation function is defined as, with the respective Jacobians regarding A and B:

\[ T = A(A^{-1}B)^{\alpha} \]

Definition at line 23 of file SlerpSE3Curve.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

curves::SlerpSE3Curve::SlerpSE3Curve ( )
virtual curves::SlerpSE3Curve::~SlerpSE3Curve ( )
virtual

Member Function Documentation

int curves::SlerpSE3Curve::baseSize ( ) const
inlinevirtual

Implements curves::SE3Curve.

Definition at line 187 of file SlerpSE3Curve.hpp.

virtual void curves::SlerpSE3Curve::clear ( )
virtual

Clear all the curve coefficients.

Implements curves::SE3Curve.

int curves::SlerpSE3Curve::correctionSize ( ) const
inlinevirtual

Returns the number of coefficients in the correction curve.

Implements curves::SE3Curve.

Definition at line 153 of file SlerpSE3Curve.hpp.

virtual ValueType curves::SlerpSE3Curve::evaluate ( Time  time) const
virtual

Evaluate the ambient space of the curve.

virtual Eigen::Vector3d curves::SlerpSE3Curve::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.

virtual Eigen::Vector3d curves::SlerpSE3Curve::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.

virtual Eigen::Vector3d curves::SlerpSE3Curve::evaluateAngularVelocityA ( Time  time)
virtual

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

Implements curves::SE3Curve.

virtual Eigen::Vector3d curves::SlerpSE3Curve::evaluateAngularVelocityB ( Time  time)
virtual

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

Implements curves::SE3Curve.

virtual DerivativeType curves::SlerpSE3Curve::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
virtual Vector6d curves::SlerpSE3Curve::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.

virtual Vector6d curves::SlerpSE3Curve::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.

virtual Eigen::Vector3d curves::SlerpSE3Curve::evaluateLinearDerivativeA ( unsigned  derivativeOrder,
Time  time 
)
virtual

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

Implements curves::SE3Curve.

virtual Eigen::Vector3d curves::SlerpSE3Curve::evaluateLinearDerivativeB ( unsigned  derivativeOrder,
Time  time 
)
virtual

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

Implements curves::SE3Curve.

virtual Eigen::Vector3d curves::SlerpSE3Curve::evaluateLinearVelocityA ( Time  time)
virtual

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

Implements curves::SE3Curve.

virtual Eigen::Vector3d curves::SlerpSE3Curve::evaluateLinearVelocityB ( Time  time)
virtual

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

Implements curves::SE3Curve.

virtual Vector6d curves::SlerpSE3Curve::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.

virtual Vector6d curves::SlerpSE3Curve::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.

virtual void curves::SlerpSE3Curve::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. Try to make the curve fit to the values. Underneath the curve should have some default policy for fitting.

Implements curves::Curve< SE3Config >.

virtual void curves::SlerpSE3Curve::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 >.

void curves::SlerpSE3Curve::foldInCorrections ( )
inlinevirtual

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

Implements curves::SE3Curve.

Definition at line 157 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::getBaseCurveTimes ( std::vector< Time > *  outTimes) const
inlinevirtual

Implements curves::SE3Curve.

Definition at line 182 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::getBaseCurveTimesInWindow ( std::vector< Time > *  outTimes,
Time  begTime,
Time  endTime 
) const
inlinevirtual

Implements curves::SE3Curve.

Definition at line 184 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::getCurveTimes ( std::vector< Time > *  outTimes) const
virtual

Implements curves::SE3Curve.

virtual Time curves::SlerpSE3Curve::getMaxTime ( ) const
virtual

The one past the last valid time for the curve.

Implements curves::Curve< SE3Config >.

virtual Time curves::SlerpSE3Curve::getMinTime ( ) const
virtual

The first valid time for the curve.

Implements curves::Curve< SE3Config >.

bool curves::SlerpSE3Curve::isEmpty ( ) const
virtual

Implements curves::SE3Curve.

void curves::SlerpSE3Curve::modifyBaseCoefficientsValuesInBatch ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)
inline

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 180 of file SlerpSE3Curve.hpp.

virtual void curves::SlerpSE3Curve::print ( const std::string &  str = "") const
virtual

Print the value of the coefficient, for debugging and unit tests.

Implements curves::Curve< SE3Config >.

void curves::SlerpSE3Curve::removeCorrectionCoefficientAtTime ( Time  time)
inlinevirtual

Remove a correction coefficient at the specified time.

Implements curves::SE3Curve.

Definition at line 163 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::resetCorrectionCurve ( const std::vector< Time > &  times)
inlinevirtual

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

Implements curves::SE3Curve.

Definition at line 169 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::saveCorrectionCurveAtTimes ( const std::string &  filename,
std::vector< Time times 
) const
inlinevirtual

Implements curves::SE3Curve.

Definition at line 145 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::saveCorrectionCurveTimesAndValues ( const std::string &  filename) const
inlinevirtual

Implements curves::SE3Curve.

Definition at line 189 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::saveCurveAtTimes ( const std::string &  filename,
std::vector< Time times 
) const
virtual

Implements curves::SE3Curve.

void curves::SlerpSE3Curve::saveCurveTimesAndValues ( const std::string &  filename) const
virtual

Implements curves::SE3Curve.

void curves::SlerpSE3Curve::setBaseCurve ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)
inline

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

Definition at line 173 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::setBaseCurvePart ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)
inline

Add / replace the given coefficients without resetting the curve.

Definition at line 176 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::setCorrectionCoefficientAtTime ( Time  time,
ValueType  value 
)
inline

Set the correction coefficient value at the specified time.

Definition at line 166 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::setCorrectionTimes ( const std::vector< Time > &  times)
inlinevirtual

Add coefficients to the correction curve at given times.

Implements curves::SE3Curve.

Definition at line 160 of file SlerpSE3Curve.hpp.

void curves::SlerpSE3Curve::setCurve ( const std::vector< Time > &  times,
const std::vector< ValueType > &  values 
)

Set some coefficients of the curve The existing curve will NOT be cleared.

void curves::SlerpSE3Curve::setMinSamplingPeriod ( Time  time)
virtual

set the minimum sampling period

Implements curves::SE3Curve.

void curves::SlerpSE3Curve::setSamplingRatio ( const int  ratio)
virtual

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

Implements curves::SE3Curve.

virtual void curves::SlerpSE3Curve::setTimeRange ( Time  minTime,
Time  maxTime 
)
virtual
int curves::SlerpSE3Curve::size ( ) const
virtual

Implements curves::SE3Curve.

void curves::SlerpSE3Curve::transformCurve ( const ValueType  T)
virtual

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

Implements curves::Curve< SE3Config >.

Friends And Related Function Documentation

friend class SamplingPolicy
friend

Definition at line 26 of file SlerpSE3Curve.hpp.

Definition at line 25 of file SlerpSE3Curve.hpp.

Definition at line 24 of file SlerpSE3Curve.hpp.

Member Data Documentation

LocalSupport2CoefficientManager<Coefficient> curves::SlerpSE3Curve::manager_
private

Definition at line 189 of file SlerpSE3Curve.hpp.

SamplingPolicy curves::SlerpSE3Curve::slerpPolicy_
private

Definition at line 193 of file SlerpSE3Curve.hpp.


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