Trajectory Class Reference

The Trajectory class represents n-dimensional sampled trajectories. More...

#include <RobotAPI/libraries/core/Trajectory.h>

+ Inheritance diagram for Trajectory:

Classes

struct  TagOrdered
 
struct  TagTimestamp
 
struct  TrajData
 

Public Types

using ordered_view = typename boost::multi_index::index< TrajDataContainer, TagOrdered >::type
 
using timestamp_view = typename boost::multi_index::index< TrajDataContainer, TagTimestamp >::type
 
typedef boost::multi_index::multi_index_container< TrajData, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::tag< TagTimestamp >, boost::multi_index::member< TrajData, double, &TrajData::timestamp > >, boost::multi_index::ordered_unique< boost::multi_index::tag< TagOrdered >, boost::multi_index::member< TrajData, double, &TrajData::timestamp > > > > TrajDataContainer
 
using TrajMap = std::map< double, std::vector< DoubleSeqPtr > >
 

Public Member Functions

void addDerivationsToDimension (size_t dimension, const double t, const Ice::DoubleSeq &derivs)
 
size_t addDimension (const Ice::DoubleSeq &values, const Ice::DoubleSeq &timestamps=Ice::DoubleSeq(), const std::string name="")
 
void addPositionsToDimension (size_t dimension, const Ice::DoubleSeq &values, const Ice::DoubleSeq &timestamps)
 
ordered_view::const_iterator begin () const
 Iterators that iterates in incremental order of the timestamps through the trajectory. More...
 
TrajectoryPtr calculateTimeOptimalTrajectory (const Eigen::VectorXd &maxVelocities, const Eigen::VectorXd &maxAccelerations, double maxDeviation, IceUtil::Time const &timestep)
 
TrajectoryPtr calculateTimeOptimalTrajectory (double maxVelocity, double maxAcceleration, double maxDeviation, IceUtil::Time const &timestep)
 
void clear (bool keepMetaData=false)
 
VariantDataClassPtr clone (const Ice::Current &c=Ice::emptyCurrent) const override
 
TrajectoryPtr cloneMetaData () const
 
TrajDataContainerdata ()
 
bool dataExists (double t, size_t dimension=0, size_t derivation=0) const
 
void deserialize (const ObjectSerializerBasePtr &, const Ice::Current &=Ice::emptyCurrent) override
 
void differentiateDiscretly (size_t derivation)
 
void differentiateDiscretlyForDim (size_t trajDimension, size_t derivation)
 
size_t dim () const
 dim returns the trajectory dimension count for this trajectory (e.g. More...
 
ordered_view::const_iterator end () const
 
void gaussianFilter (double filterRadius)
 gaussianFilter smoothes the trajectory More...
 
std::vector< Ice::DoubleSeq > getAllStates (double t, int maxDeriv=1)
 
double getAmplitude (size_t dimension, size_t derivation, double startTime, double endTime) const
 
Ice::DoubleSeq getDerivations (double t, size_t dimension, size_t derivations) const
 
Ice::DoubleSeq getDimensionData (size_t dimension, size_t derivation=0) const
 getDimensionData gets all entries for one dimensions with order of increasing timestamps More...
 
Eigen::VectorXd getDimensionDataAsEigen (size_t dimension, size_t derivation) const
 
Eigen::VectorXd getDimensionDataAsEigen (size_t dimension, size_t derivation, double startTime, double endTime) const
 
std::string getDimensionName (size_t dim) const
 
const Ice::StringSeq & getDimensionNames () const
 
double getDiscretDifferentiationForDimAtT (double t, size_t trajDimension, size_t derivation) const
 
Ice::DoubleSeq getDiscreteDifferentiationForDim (size_t trajDimension, size_t derivation) const
 
double getLength (size_t derivation, double startTime, double endTime) const
 
double getLength (size_t derivation=0) const
 Returns the sum of a all subsequent distances of the entries in the trajectories over all dimensions. More...
 
double getLength (size_t dimension, size_t derivation) const
 
double getLength (size_t dimension, size_t derivation, double startTime, double endTime) const
 
LimitlessStateSeq getLimitless () const
 
double getMax (size_t dimension, size_t derivation, double startTime, double endTime) const
 
Ice::DoubleSeq getMaxima (size_t dimension, size_t derivation, double startTime, double endTime) const
 
Ice::DoubleSeq getMaximaTimestamps (size_t dimension, size_t derivation, double startTime, double endTime) const
 
double getMin (size_t dimension, size_t derivation, double startTime, double endTime) const
 
Ice::DoubleSeq getMinima (size_t dimension, size_t derivation, double startTime, double endTime) const
 Calculate all minima. More...
 
Ice::DoubleSeq getMinimaTimestamps (size_t dimension, size_t derivation, double startTime, double endTime) const
 
TrajectoryPtr getPart (double startTime, double endTime, size_t numberOfDerivations=0) const
 
double getSquaredLength (size_t dimension, size_t derivation) const
 
double getSquaredLength (size_t dimension, size_t derivation, double startTime, double endTime) const
 
double getState (double t, size_t dim=0, size_t derivation=0)
 
double getState (double t, size_t dim=0, size_t derivation=0) const
 
std::vector< DoubleSeqPtr > & getStates (double t)
 
std::vector< DoubleSeqPtrgetStates (double t) const
 
Ice::DoubleSeq getStates (double t, size_t derivation) const
 
std::map< double, Ice::DoubleSeq > getStatesAround (double t, size_t derivation, size_t extend) const
 
template<typename T >
std::map< std::string, TgetStatesMap (double t, size_t derivation=0) const
 
double getTimeLength () const
 Difference between biggest and smallest timestamp. More...
 
Ice::DoubleSeq getTimestamps () const
 
Ice::FloatSeq getTimestampsFloat () const
 
Ice::Int getType (const Ice::Current &c=Ice::emptyCurrent) const override
 
double getWithFunc (const double &(*foo)(const double &, const double &), double initValue, size_t dimension, size_t derivation, double startTime, double endTime) const
 
Ice::ObjectPtr ice_clone () const override
 
void ice_postUnmarshal () override
 
void ice_preMarshal () override
 
void negateDim (size_t trajDimension)
 negateDim changes the sign of all values of the given dimension. More...
 
TrajectoryPtr normalize (const double startTime=0.0, const double endTime=1.0)
 
Trajectoryoperator+= (const Trajectory traj)
 
Trajectoryoperator= (const Trajectory &source)
 
std::vector< DoubleSeqPtr > & operator[] (double timestamp)
 
std::string output (const Ice::Current &c=Ice::emptyCurrent) const override
 
ordered_view::const_reverse_iterator rbegin () const
 
void reconstructFromDerivativeForDim (double valueAtFirstTimestamp, size_t trajDimension, size_t sourceDimOfSystemState, size_t targetDimOfSystemState)
 
void removeDerivation (size_t derivation)
 
void removeDerivation (size_t dimension, size_t derivation)
 
void removeDimension (size_t dimension)
 
ordered_view::const_reverse_iterator rend () const
 
void scaleValue (const Ice::DoubleSeq &factor)
 
void serialize (const ObjectSerializerBasePtr &obj, const Ice::Current &=Ice::emptyCurrent) const override
 
void setDimensionNames (const Ice::StringSeq dimNames)
 
void setEntries (const double t, const size_t dimIndex, const Ice::DoubleSeq &y)
 
void setLimitless (const LimitlessStateSeq &limitlessStates)
 
void setPositionEntry (const double t, const size_t dimIndex, const double &y)
 
void shiftTime (double shift)
 
void shiftValue (const Ice::DoubleSeq &shift)
 
size_t size () const
 Returns number of data entries (i.e. More...
 
Eigen::MatrixXd toEigen (size_t derivation, double startTime, double endTime) const
 
Eigen::MatrixXd toEigen (size_t derivation=0) const
 
 Trajectory ()
 
 Trajectory (const std::map< double, Ice::DoubleSeq > &data)
 
template<typename T >
 Trajectory (const std::vector< std::vector< std::vector< T >>> &data, const Ice::DoubleSeq timestamps=Ice::DoubleSeq(), const Ice::StringSeq &dimensionNames={})
 
template<typename T >
 Trajectory (const std::vector< std::vector< T >> &data, const Ice::DoubleSeq timestamps=Ice::DoubleSeq(), const Ice::StringSeq &dimensionNames={})
 Constructor to add n-dimensions with m-values. More...
 
template<typename T >
 Trajectory (const std::vector< T > &data, const Ice::DoubleSeq timestamps=Ice::DoubleSeq(), const std::string &dimensionName="", typename std::enable_if_t< std::is_arithmetic_v< T >> *t=0)
 
 Trajectory (const Trajectory &source)
 
bool validate (const Ice::Current &c=Ice::emptyCurrent) override
 

Static Public Member Functions

static void CopyData (const Trajectory &source, Trajectory &destination)
 
static void CopyMetaData (const Trajectory &source, Trajectory &destination)
 
static Ice::DoubleSeq DifferentiateDiscretly (const Ice::DoubleSeq &timestamps, const Ice::DoubleSeq &values, int derivationCount=1)
 
template<typename T >
static Ice::DoubleSeq GenerateTimestamps (const std::vector< T > &values)
 
static Ice::DoubleSeq GenerateTimestamps (double startTime=0.0, double endTime=1.0, double stepSize=0.001)
 
static Ice::DoubleSeq NormalizeTimestamps (const Ice::DoubleSeq &timestamps, const double startTime=0.0, const double endTime=1.0)
 
static Trajectory NormalizeTimestamps (const Trajectory &traj, const double startTime=0.0, const double endTime=1.0)
 

Protected Member Functions

void __addDimension ()
 
std::vector< DoubleSeqPtr__calcBaseDataAtTimestamp (const double &t) const
 
void __fillAllEmptyFields ()
 
timestamp_view::iterator __fillBaseDataAtTimestamp (const double &t)
 
double __gaussianFilter (double filterRadius, typename ordered_view::iterator centerIt, size_t trajNum, size_t dim)
 
virtual double __interpolate (double t, ordered_view::const_iterator itPrev, ordered_view::const_iterator itNext, size_t dimension, size_t derivation) const
 
double __interpolate (double t, size_t dimension, size_t derivation) const
 
double __interpolate (typename ordered_view::const_iterator itMap, size_t dimension, size_t derivation) const
 
 ~Trajectory () override
 

Protected Attributes

TrajDataContainer dataMap
 

Detailed Description

The Trajectory class represents n-dimensional sampled trajectories.

The class interpolates all missing values with linear interpolation and calculates derivations. This means trajectories with different timestamps can easily be used. Velocities or accelerations can easily be queried with the derivation parameters of many functions. Access complexity for a query with a timestamp is like from an unordered_map.

Internal structure of the Trajectory class

Basic usage:

Ice::DoubleSeq joint1Values{0, 5, 1}; // fill with your values;
Ice::DoubleSeq joint2Values{1, 3, 1}; // fill with your values;
Ice::DoubleSeq joint3Values{0, 2, 5}; // fill with your values;
Ice::DoubleSeq timestamps = Trajectory::GenerateTimestamps(
0, 1, 1.0 / (joint1Values.size() - 1)); // if you dont have timestamps
TrajectoryPtr trajectory(new Trajectory(
DoubleSeqSeq{joint1Values, joint2Values}, timestamps, {"Shoulder 0 R", "Shoulder 1 R"}));
trajectory->addDimension(joint3Values, timestamps, "Shoulder 2 R");
double timestamp = 0.1;
double dimension = 0;
double derivation = 0;
double j1posAtT = trajectory->getState(timestamp, dimension, derivation);
// or
Ice::DoubleSeq j1positions = trajectory->getDimensionData(dimension, derivation);

The trajectory offers normal iterator capabilities:

Trajectory::ordered_view::iterator it; // or just auto it;
it = trajectory->begin();
for (; it != trajectory->end(); it++)
{
const Trajectory::TrajData& data = *it;
ARMARX_INFO_S << "Position at " << data.getTimestamp() << " :" << data.getPosition(0);
}
// or with c++11 for loop:
for (const Trajectory::TrajData& element : *trajectory)
{
ARMARX_INFO_S << "Position at " << element.getTimestamp() << " :" << element.getPosition(0);
}
Note
Only const iterators are currently available.

With the iterators it can be used like a std container:

FloatSeqSeq positions{{0, 0, 1}, {0, 1, 1}};
TrajectoryPtr traj = new Trajectory(positions, {}, {"joint1", "joint2"});
std::vector<Trajectory::TrajData> selection(traj->size());
// select all elements with velocity > 0
auto it = std::copy_if(traj->begin(),
traj->end(),
selection.begin(),
[](const Trajectory::TrajData& elem)
{ return fabs(elem.getDeriv(0, 1)) > 0; });
selection.resize(std::distance(selection.begin(), it));

Definition at line 76 of file Trajectory.h.

Member Typedef Documentation

◆ ordered_view

Definition at line 215 of file Trajectory.h.

◆ timestamp_view

Definition at line 213 of file Trajectory.h.

◆ TrajDataContainer

typedef boost::multi_index::multi_index_container< TrajData, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::tag<TagTimestamp>, boost::multi_index::member<TrajData, double, &TrajData::timestamp> >, boost::multi_index::ordered_unique< boost::multi_index::tag<TagOrdered>, boost::multi_index::member< TrajData, double, &TrajData::timestamp> > > > TrajDataContainer

Definition at line 211 of file Trajectory.h.

◆ TrajMap

using TrajMap = std::map<double, std::vector<DoubleSeqPtr> >

Definition at line 82 of file Trajectory.h.

Constructor & Destructor Documentation

◆ ~Trajectory()

~Trajectory ( )
overrideprotecteddefault

◆ Trajectory() [1/6]

Trajectory ( )
inline

Definition at line 217 of file Trajectory.h.

+ Here is the caller graph for this function:

◆ Trajectory() [2/6]

Trajectory ( const Trajectory source)

Definition at line 190 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ Trajectory() [3/6]

Trajectory ( const std::vector< T > &  data,
const Ice::DoubleSeq  timestamps = Ice::DoubleSeq(),
const std::string &  dimensionName = "",
typename std::enable_if_t< std::is_arithmetic_v< T >> *  t = 0 
)
inline

Definition at line 224 of file Trajectory.h.

+ Here is the call graph for this function:

◆ Trajectory() [4/6]

Trajectory ( const std::vector< std::vector< T >> &  data,
const Ice::DoubleSeq  timestamps = Ice::DoubleSeq(),
const Ice::StringSeq &  dimensionNames = {} 
)
inline

Constructor to add n-dimensions with m-values.

Parameters
datadata vector (size n) with positions (size m). Dimension 1 is the joint dimension and Dimension 2 is the position of that joint.
timestampstimestamps of the trajectory. If not empty, need to be of same size as the inner values of data. If empty, timestamps from 0..1 are generated with a stepsize aligned with the size of the inner vector of data.

Definition at line 245 of file Trajectory.h.

◆ Trajectory() [5/6]

Trajectory ( const std::vector< std::vector< std::vector< T >>> &  data,
const Ice::DoubleSeq  timestamps = Ice::DoubleSeq(),
const Ice::StringSeq &  dimensionNames = {} 
)
inline

Definition at line 265 of file Trajectory.h.

◆ Trajectory() [6/6]

Trajectory ( const std::map< double, Ice::DoubleSeq > &  data)

Definition at line 199 of file Trajectory.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ __addDimension()

void __addDimension ( )
protected

Definition at line 1081 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __calcBaseDataAtTimestamp()

std::vector< DoubleSeqPtr > __calcBaseDataAtTimestamp ( const double &  t) const
protected

Definition at line 897 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __fillAllEmptyFields()

void __fillAllEmptyFields ( )
protected

Definition at line 1150 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ __fillBaseDataAtTimestamp()

Trajectory::timestamp_view::iterator __fillBaseDataAtTimestamp ( const double &  t)
protected

Definition at line 932 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __gaussianFilter()

double __gaussianFilter ( double  filterRadius,
typename ordered_view::iterator  centerIt,
size_t  trajNum,
size_t  dim 
)
protected

Definition at line 1666 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __interpolate() [1/3]

double __interpolate ( double  t,
ordered_view::const_iterator  itPrev,
ordered_view::const_iterator  itNext,
size_t  dimension,
size_t  derivation 
) const
protectedvirtual

Definition at line 1566 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ __interpolate() [2/3]

double __interpolate ( double  t,
size_t  dimension,
size_t  derivation 
) const
protected

Definition at line 1528 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ __interpolate() [3/3]

double __interpolate ( typename ordered_view::const_iterator  itMap,
size_t  dimension,
size_t  derivation 
) const
protected

Definition at line 1554 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ addDerivationsToDimension()

void addDerivationsToDimension ( size_t  dimension,
const double  t,
const Ice::DoubleSeq &  derivs 
)

Definition at line 2066 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ addDimension()

size_t addDimension ( const Ice::DoubleSeq &  values,
const Ice::DoubleSeq &  timestamps = Ice::DoubleSeq(),
const std::string  name = "" 
)

Definition at line 1933 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPositionsToDimension()

void addPositionsToDimension ( size_t  dimension,
const Ice::DoubleSeq &  values,
const Ice::DoubleSeq &  timestamps 
)

Definition at line 2043 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ begin()

Trajectory::ordered_view::const_iterator begin ( ) const

Iterators that iterates in incremental order of the timestamps through the trajectory.

Note
Only const versions are available currently.
See also
end(), rbegin(), rend()

Definition at line 2013 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ calculateTimeOptimalTrajectory() [1/2]

TrajectoryPtr calculateTimeOptimalTrajectory ( const Eigen::VectorXd &  maxVelocities,
const Eigen::VectorXd &  maxAccelerations,
double  maxDeviation,
IceUtil::Time const &  timestep 
)

Definition at line 1850 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ calculateTimeOptimalTrajectory() [2/2]

TrajectoryPtr calculateTimeOptimalTrajectory ( double  maxVelocity,
double  maxAcceleration,
double  maxDeviation,
IceUtil::Time const &  timestep 
)

Definition at line 1838 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ clear()

void clear ( bool  keepMetaData = false)

Definition at line 1743 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ clone()

VariantDataClassPtr clone ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Definition at line 138 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneMetaData()

TrajectoryPtr cloneMetaData ( ) const

Definition at line 144 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ CopyData()

void CopyData ( const Trajectory source,
Trajectory destination 
)
static

Definition at line 1716 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CopyMetaData()

void CopyMetaData ( const Trajectory source,
Trajectory destination 
)
static

Definition at line 1735 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ data()

Definition at line 384 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ dataExists()

bool dataExists ( double  t,
size_t  dimension = 0,
size_t  derivation = 0 
) const

Definition at line 916 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ deserialize()

void deserialize ( const ObjectSerializerBasePtr &  serializer,
const Ice::Current &  = Ice::emptyCurrent 
)
override

Definition at line 114 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ DifferentiateDiscretly()

Ice::DoubleSeq DifferentiateDiscretly ( const Ice::DoubleSeq &  timestamps,
const Ice::DoubleSeq &  values,
int  derivationCount = 1 
)
static

Definition at line 1250 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ differentiateDiscretly()

void differentiateDiscretly ( size_t  derivation)

Definition at line 1449 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ differentiateDiscretlyForDim()

void differentiateDiscretlyForDim ( size_t  trajDimension,
size_t  derivation 
)

Definition at line 1459 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dim()

size_t dim ( ) const

dim returns the trajectory dimension count for this trajectory (e.g.

taskspace w/o orientation would be 3)

Returns

Definition at line 522 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ end()

Trajectory::ordered_view::const_iterator end ( ) const

Definition at line 2019 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ gaussianFilter()

void gaussianFilter ( double  filterRadius)

gaussianFilter smoothes the trajectory

Parameters
filterRadius,ineasy words: time range to left and right from center that influences the resulting center value

Definition at line 1642 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ GenerateTimestamps() [1/2]

static Ice::DoubleSeq GenerateTimestamps ( const std::vector< T > &  values)
inlinestatic

Definition at line 465 of file Trajectory.h.

+ Here is the call graph for this function:

◆ GenerateTimestamps() [2/2]

Ice::DoubleSeq GenerateTimestamps ( double  startTime = 0.0,
double  endTime = 1.0,
double  stepSize = 0.001 
)
static

Definition at line 1754 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllStates()

std::vector< Ice::DoubleSeq > getAllStates ( double  t,
int  maxDeriv = 1 
)

Definition at line 333 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getAmplitude()

double getAmplitude ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 736 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getDerivations()

Ice::DoubleSeq getDerivations ( double  t,
size_t  dimension,
size_t  derivations 
) const

Definition at line 353 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getDimensionData()

Ice::DoubleSeq getDimensionData ( size_t  dimension,
size_t  derivation = 0 
) const

getDimensionData gets all entries for one dimensions with order of increasing timestamps

Parameters
dimension
derivation
Returns

Definition at line 390 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDimensionDataAsEigen() [1/2]

Eigen::VectorXd getDimensionDataAsEigen ( size_t  dimension,
size_t  derivation 
) const

Definition at line 416 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getDimensionDataAsEigen() [2/2]

Eigen::VectorXd getDimensionDataAsEigen ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 423 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getDimensionName()

std::string getDimensionName ( size_t  dim) const

Definition at line 372 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDimensionNames()

const Ice::StringSeq & getDimensionNames ( ) const

Definition at line 378 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ getDiscretDifferentiationForDimAtT()

double getDiscretDifferentiationForDimAtT ( double  t,
size_t  trajDimension,
size_t  derivation 
) const

Definition at line 1296 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDiscreteDifferentiationForDim()

Ice::DoubleSeq getDiscreteDifferentiationForDim ( size_t  trajDimension,
size_t  derivation 
) const

Definition at line 1201 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getLength() [1/4]

double getLength ( size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 566 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getLength() [2/4]

double getLength ( size_t  derivation = 0) const

Returns the sum of a all subsequent distances of the entries in the trajectories over all dimensions.

Parameters
derivationDerivation for which the length is calculated

Definition at line 556 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLength() [3/4]

double getLength ( size_t  dimension,
size_t  derivation 
) const

Definition at line 617 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getLength() [4/4]

double getLength ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 627 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getLimitless()

LimitlessStateSeq getLimitless ( ) const

Definition at line 2214 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ getMax()

double getMax ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 689 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaxima()

Ice::DoubleSeq getMaxima ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 822 of file Trajectory.cpp.

◆ getMaximaTimestamps()

Ice::DoubleSeq getMaximaTimestamps ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 859 of file Trajectory.cpp.

◆ getMin()

double getMin ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 700 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMinima()

Ice::DoubleSeq getMinima ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Calculate all minima.

Parameters
dimension
derivation
startTime
endTime
Returns

Definition at line 746 of file Trajectory.cpp.

◆ getMinimaTimestamps()

Ice::DoubleSeq getMinimaTimestamps ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 784 of file Trajectory.cpp.

◆ getPart()

TrajectoryPtr getPart ( double  startTime,
double  endTime,
size_t  numberOfDerivations = 0 
) const

Definition at line 492 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getSquaredLength() [1/2]

double getSquaredLength ( size_t  dimension,
size_t  derivation 
) const

Definition at line 656 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getSquaredLength() [2/2]

double getSquaredLength ( size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 663 of file Trajectory.cpp.

◆ getState() [1/2]

double getState ( double  t,
size_t  dim = 0,
size_t  derivation = 0 
)

Definition at line 237 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getState() [2/2]

double getState ( double  t,
size_t  dim = 0,
size_t  derivation = 0 
) const

Definition at line 299 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getStates() [1/3]

std::vector< DoubleSeqPtr > & getStates ( double  t)

Definition at line 971 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStates() [2/3]

std::vector< DoubleSeqPtr > getStates ( double  t) const

Definition at line 986 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getStates() [3/3]

Ice::DoubleSeq getStates ( double  t,
size_t  derivation 
) const

Definition at line 1001 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getStatesAround()

std::map< double, Ice::DoubleSeq > getStatesAround ( double  t,
size_t  derivation,
size_t  extend 
) const

Definition at line 1015 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getStatesMap()

std::map<std::string, T> getStatesMap ( double  t,
size_t  derivation = 0 
) const
inline

Definition at line 316 of file Trajectory.h.

+ Here is the call graph for this function:

◆ getTimeLength()

double getTimeLength ( ) const

Difference between biggest and smallest timestamp.

If size() <=1 -> return 0.

Definition at line 541 of file Trajectory.cpp.

◆ getTimestamps()

Ice::DoubleSeq getTimestamps ( ) const

Definition at line 1169 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTimestampsFloat()

Ice::FloatSeq getTimestampsFloat ( ) const

Definition at line 1185 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ getType()

Ice::Int getType ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Definition at line 173 of file Trajectory.cpp.

◆ getWithFunc()

double getWithFunc ( const double &(*)(const double &, const double &)  foo,
double  initValue,
size_t  dimension,
size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 711 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ ice_clone()

Ice::ObjectPtr ice_clone ( ) const
override

Definition at line 185 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ ice_postUnmarshal()

void ice_postUnmarshal ( )
override

Definition at line 71 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ ice_preMarshal()

void ice_preMarshal ( )
override

Definition at line 44 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ negateDim()

void negateDim ( size_t  trajDimension)

negateDim changes the sign of all values of the given dimension.

Definition at line 1509 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ normalize()

TrajectoryPtr normalize ( const double  startTime = 0.0,
const double  endTime = 1.0 
)

Definition at line 1830 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ NormalizeTimestamps() [1/2]

Ice::DoubleSeq NormalizeTimestamps ( const Ice::DoubleSeq &  timestamps,
const double  startTime = 0.0,
const double  endTime = 1.0 
)
static

Definition at line 1781 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ NormalizeTimestamps() [2/2]

Trajectory NormalizeTimestamps ( const Trajectory traj,
const double  startTime = 0.0,
const double  endTime = 1.0 
)
static

Definition at line 1801 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator+=()

Trajectory & operator+= ( const Trajectory  traj)

Definition at line 1067 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ operator=()

Trajectory & operator= ( const Trajectory source)

Definition at line 230 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ operator[]()

std::vector< DoubleSeqPtr > & operator[] ( double  timestamp)

Definition at line 2037 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ output()

std::string output ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Definition at line 152 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ rbegin()

Trajectory::ordered_view::const_reverse_iterator rbegin ( ) const

Definition at line 2025 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ reconstructFromDerivativeForDim()

void reconstructFromDerivativeForDim ( double  valueAtFirstTimestamp,
size_t  trajDimension,
size_t  sourceDimOfSystemState,
size_t  targetDimOfSystemState 
)

Definition at line 1471 of file Trajectory.cpp.

◆ removeDerivation() [1/2]

void removeDerivation ( size_t  derivation)

Definition at line 1978 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeDerivation() [2/2]

void removeDerivation ( size_t  dimension,
size_t  derivation 
)

Definition at line 1997 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ removeDimension()

void removeDimension ( size_t  dimension)

Definition at line 1958 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ rend()

Trajectory::ordered_view::const_reverse_iterator rend ( ) const

Definition at line 2031 of file Trajectory.cpp.

◆ scaleValue()

void scaleValue ( const Ice::DoubleSeq &  factor)

Definition at line 2186 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ serialize()

void serialize ( const ObjectSerializerBasePtr &  obj,
const Ice::Current &  = Ice::emptyCurrent 
) const
override

Definition at line 90 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ setDimensionNames()

void setDimensionNames ( const Ice::StringSeq  dimNames)
inline

Definition at line 508 of file Trajectory.h.

+ Here is the caller graph for this function:

◆ setEntries()

void setEntries ( const double  t,
const size_t  dimIndex,
const Ice::DoubleSeq &  y 
)

Definition at line 1094 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLimitless()

void setLimitless ( const LimitlessStateSeq &  limitlessStates)

Definition at line 2208 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ setPositionEntry()

void setPositionEntry ( const double  t,
const size_t  dimIndex,
const double &  y 
)

Definition at line 1123 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shiftTime()

void shiftTime ( double  shift)

Definition at line 2145 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ shiftValue()

void shiftValue ( const Ice::DoubleSeq &  shift)

Definition at line 2164 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ size()

size_t size ( ) const

Returns number of data entries (i.e.

positions) in the trajectory.

Definition at line 535 of file Trajectory.cpp.

+ Here is the caller graph for this function:

◆ toEigen() [1/2]

Eigen::MatrixXd toEigen ( size_t  derivation,
double  startTime,
double  endTime 
) const

Definition at line 459 of file Trajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toEigen() [2/2]

Eigen::MatrixXd toEigen ( size_t  derivation = 0) const

Definition at line 482 of file Trajectory.cpp.

+ Here is the call graph for this function:

◆ validate()

bool validate ( const Ice::Current &  c = Ice::emptyCurrent)
override

Definition at line 179 of file Trajectory.cpp.

Member Data Documentation

◆ dataMap

TrajDataContainer dataMap
protected

Definition at line 530 of file Trajectory.h.


The documentation for this class was generated from the following files:
armarx::Trajectory::data
TrajDataContainer & data()
Definition: Trajectory.cpp:384
armarx::Trajectory::GenerateTimestamps
static Ice::DoubleSeq GenerateTimestamps(double startTime=0.0, double endTime=1.0, double stepSize=0.001)
Definition: Trajectory.cpp:1754
armarx::TrajectoryPtr
IceInternal::Handle< Trajectory > TrajectoryPtr
Definition: Trajectory.h:52
armarx::Trajectory::Trajectory
Trajectory()
Definition: Trajectory.h:217
distance
double distance(const Point &a, const Point &b)
Definition: point.hpp:95
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:202