RobWorkProject  24.12.4-
Public Member Functions | List of all members
InterpolatorTrajectoryIterator< T > Class Template Reference

Bi-directional iterator for running efficiently through a trajectory. More...

#include <InterpolatorTrajectoryIterator.hpp>

Inherits TrajectoryIterator< T >.

Public Member Functions

 InterpolatorTrajectoryIterator (const InterpolatorTrajectory< T > *trajectory, double dt=1)
 Constructs iterator for trajectory. More...
 
virtual ~InterpolatorTrajectoryIterator ()
 destructor
 
double getTime ()
 Returns the current position (time) of the iterator. More...
 
void operator-= (double dt)
 This function can be used to decrease the iterator position. The position can be decreased no longer than to time equals 0. More...
 
void operator+= (double dt)
 This function can be used to increase the iterator position. The position can be increased no longer than the length of the complete trajectory. More...
 
rw::trajectory::TrajectoryIteratoroperator++ ()
 Operator overloading ++ for increasing the position of the iterator. More...
 
rw::trajectory::TrajectoryIteratoroperator-- ()
 Operator overloading – for decreasing the position of the iterator. More...
 
bool isEnd ()
 Test if the end of the trajectory is reached. More...
 
bool isBegin ()
 Test if the beginning of the trajectory is reached. More...
 
operator* () const
 Extracts a point at the current position in the trajectory. More...
 
x () const
 Extracts a point at the current position in the trajectory. More...
 
dx () const
 Extracts a point of the derivative of the trajectory at the current position in the trajectory. More...
 
ddx () const
 Extracts a point of the double derivative of the trajectory at the current position in the trajectory. More...
 
- Public Member Functions inherited from TrajectoryIterator< T >
virtual ~TrajectoryIterator ()
 destructor
 
virtual double getTime () const =0
 Returns the current position (time) of the iterator. More...
 
virtual void inc ()=0
 Method for increasing the position of the iterator a fixed amount. More...
 
virtual void inc (double dt)=0
 Method for increasing the position of the iterator by dt. More...
 
virtual void dec ()=0
 Method for decreasing the position of the iterator a fixed amount. More...
 
virtual void dec (double dt)=0
 Method for decreasing the position of the iterator a fixed amount. More...
 
virtual void operator++ (int)
 Operator overloading ++ for increasing the position of the iterator. More...
 
virtual void operator-- (int)
 Operator overloading – for decreasing the position of the iterator. More...
 
virtual bool isEnd () const =0
 Test if the end of the trajectory is reached. More...
 
virtual bool isBegin () const =0
 Test if the beginning of the trajectory is reached. More...
 

Additional Inherited Members

- Public Types inherited from TrajectoryIterator< T >
typedef rw::core::Ptr< TrajectoryIterator< T > > Ptr
 smart pointer type
 

Detailed Description

template<class T>
class rw::trajectory::InterpolatorTrajectoryIterator< T >

Bi-directional iterator for running efficiently through a trajectory.

Constructor & Destructor Documentation

◆ InterpolatorTrajectoryIterator()

InterpolatorTrajectoryIterator ( const InterpolatorTrajectory< T > *  trajectory,
double  dt = 1 
)
inline

Constructs iterator for trajectory.

Parameters
trajectory[in] Trajectory to iterate through
dt[in] Default stepsize used for ++ and – operators

Member Function Documentation

◆ ddx()

T ddx ( ) const
inlinevirtual

Extracts a point of the double derivative of the trajectory at the current position in the trajectory.

Returns
the double derived point at the current position in the trajectory.

Implements TrajectoryIterator< T >.

◆ dx()

T dx ( ) const
inlinevirtual

Extracts a point of the derivative of the trajectory at the current position in the trajectory.

Returns
the derived point at the current position in the trajectory.

Implements TrajectoryIterator< T >.

◆ getTime()

double getTime ( )
inline

Returns the current position (time) of the iterator.

Returns
The current time.

◆ isBegin()

bool isBegin ( )
inline

Test if the beginning of the trajectory is reached.

Returns
true if the iterator has reached the beginning of the trajectory false otherwise.

◆ isEnd()

bool isEnd ( )
inline

Test if the end of the trajectory is reached.

Returns
true if the iterator has reached the end of the trajectory false otherwise.

◆ operator*()

T operator* ( ) const
inlinevirtual

Extracts a point at the current position in the trajectory.

Returns
the point at the current position in the trajectory.

Implements TrajectoryIterator< T >.

◆ operator++()

rw::trajectory::TrajectoryIterator& operator++ ( )
inlinevirtual

Operator overloading ++ for increasing the position of the iterator.

Usage: ++iterator

The increment is equal to the dt specified in the constructor.

Returns
Reference to the TrajectoryIterator

Reimplemented from TrajectoryIterator< T >.

◆ operator+=()

void operator+= ( double  dt)
inlinevirtual

This function can be used to increase the iterator position. The position can be increased no longer than the length of the complete trajectory.

Parameters
dt[in] a double that describes how much to increase the iterator position

Reimplemented from TrajectoryIterator< T >.

◆ operator--()

rw::trajectory::TrajectoryIterator& operator-- ( )
inlinevirtual

Operator overloading – for decreasing the position of the iterator.

Usage: –iterator;

The decrement is equal to the dt specified in the constructor.

Returns
Reference to the TrajectoryIterator

Reimplemented from TrajectoryIterator< T >.

◆ operator-=()

void operator-= ( double  dt)
inlinevirtual

This function can be used to decrease the iterator position. The position can be decreased no longer than to time equals 0.

Parameters
dt[in] a double that describes how much to decrease the iterator position

Reimplemented from TrajectoryIterator< T >.

◆ x()

T x ( ) const
inlinevirtual

Extracts a point at the current position in the trajectory.

Returns
the point at the current position in the trajectory.

Implements TrajectoryIterator< T >.


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