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

#include <SlerpSE2Curve.hpp>

Inheritance diagram for curves::SlerpSE2Curve:
Inheritance graph

Public Types

typedef SE2Curve::ValueType ValueType
 
typedef SE2Curve::DerivativeType DerivativeType
 
typedef ValueType Coefficient
 
typedef LocalSupport2CoefficientManager< Coefficient >::TimeToKeyCoefficientMap TimeToKeyCoefficientMap
 
typedef LocalSupport2CoefficientManager< Coefficient >::CoefficientIter CoefficientIter
 
- Public Types inherited from curves::SE2Curve
typedef Curve< SE2ConfigParent
 
typedef Parent::ValueType ValueType
 
typedef Parent::DerivativeType DerivativeType
 
- Public Types inherited from curves::Curve< SE2Config >
typedef SE2Config::ValueType ValueType
 The value type of the curve. More...
 
typedef SE2Config::DerivativeType DerivativeType
 The curve's derivative type. More...
 

Public Member Functions

 SlerpSE2Curve ()
 
virtual ~SlerpSE2Curve ()
 
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 gtsam::Expression< ValueTypegetValueExpression (const Time &time) const
 Get an evaluator at this time. More...
 
virtual gtsam::Expression< DerivativeTypegetDerivativeExpression (const Time &time, unsigned derivativeOrder) const
 
virtual void setTimeRange (Time minTime, Time maxTime)
 
virtual void initializeGTSAMValues (gtsam::KeySet keys, gtsam::Values *values) const
 Initialize a GTSAM values structure with the desired keys. More...
 
virtual void initializeGTSAMValues (gtsam::Values *values) const
 Initialize a GTSAM values structure for all keys. More...
 
virtual void updateFromGTSAMValues (const gtsam::Values &values)
 
void setMinSamplingPeriod (Time time)
 
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 addPriorFactors (gtsam::NonlinearFactorGraph *graph, Time priorTime) const
 Add factors to constrain the variables active at this time. More...
 
void transformCurve (const ValueType T)
 Perform a rigid transformation on the left side of the curve. More...
 
virtual Time getTimeAtKey (gtsam::Key key) const
 
void saveCurveTimesAndValues (const std::string &filename) const
 
- Public Member Functions inherited from curves::SE2Curve
 SE2Curve ()
 
virtual ~SE2Curve ()
 
- Public Member Functions inherited from curves::Curve< SE2Config >
 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 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 21 of file SlerpSE2Curve.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

curves::SlerpSE2Curve::SlerpSE2Curve ( )
virtual curves::SlerpSE2Curve::~SlerpSE2Curve ( )
virtual

Member Function Documentation

void curves::SlerpSE2Curve::addPriorFactors ( gtsam::NonlinearFactorGraph *  graph,
Time  priorTime 
) const

Add factors to constrain the variables active at this time.

virtual void curves::SlerpSE2Curve::clear ( )
virtual

Clear all the curve coefficients.

Implements curves::Curve< SE2Config >.

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

Evaluate the ambient space of the curve.

virtual DerivativeType curves::SlerpSE2Curve::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 void curves::SlerpSE2Curve::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< SE2Config >.

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

virtual gtsam::Expression<DerivativeType> curves::SlerpSE2Curve::getDerivativeExpression ( const Time time,
unsigned  derivativeOrder 
) const
virtual
virtual Time curves::SlerpSE2Curve::getMaxTime ( ) const
virtual

The one past the last valid time for the curve.

Implements curves::Curve< SE2Config >.

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

The first valid time for the curve.

Implements curves::Curve< SE2Config >.

virtual Time curves::SlerpSE2Curve::getTimeAtKey ( gtsam::Key  key) const
virtual
virtual gtsam::Expression<ValueType> curves::SlerpSE2Curve::getValueExpression ( const Time time) const
virtual

Get an evaluator at this time.

virtual void curves::SlerpSE2Curve::initializeGTSAMValues ( gtsam::KeySet  keys,
gtsam::Values *  values 
) const
virtual

Initialize a GTSAM values structure with the desired keys.

virtual void curves::SlerpSE2Curve::initializeGTSAMValues ( gtsam::Values *  values) const
virtual

Initialize a GTSAM values structure for all keys.

bool curves::SlerpSE2Curve::isEmpty ( ) const
virtual void curves::SlerpSE2Curve::print ( const std::string &  str = "") const
virtual

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

Implements curves::Curve< SE2Config >.

void curves::SlerpSE2Curve::saveCurveTimesAndValues ( const std::string &  filename) const
void curves::SlerpSE2Curve::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::SlerpSE2Curve::setMinSamplingPeriod ( Time  time)
void curves::SlerpSE2Curve::setSamplingRatio ( const int  ratio)

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

virtual void curves::SlerpSE2Curve::setTimeRange ( Time  minTime,
Time  maxTime 
)
virtual
int curves::SlerpSE2Curve::size ( ) const
void curves::SlerpSE2Curve::transformCurve ( const ValueType  T)
virtual

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

Implements curves::Curve< SE2Config >.

virtual void curves::SlerpSE2Curve::updateFromGTSAMValues ( const gtsam::Values &  values)
virtual

Friends And Related Function Documentation

friend class SamplingPolicy
friend

Definition at line 24 of file SlerpSE2Curve.hpp.

Member Data Documentation

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

Definition at line 117 of file SlerpSE2Curve.hpp.

SamplingPolicy curves::SlerpSE2Curve::slerpPolicy_
private

Definition at line 118 of file SlerpSE2Curve.hpp.


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