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

Combines a number of trajectories. More...

#include <TrajectorySequence.hpp>

Inherits Trajectory< T >.

Public Types

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

Public Member Functions

 TrajectorySequence (const std::vector< typename rw::trajectory::Trajectory< T >::Ptr > trajectories)
 Create a trajectory from trajectories. More...
 
 TrajectorySequence (typename rw::trajectory::Trajectory< T >::Ptr trajectory1, typename rw::trajectory::Trajectory< T >::Ptr trajectory2)
 Create a trajectory from trajectory1 and \ trajectory2. More...
 
virtual T x (double t) const
 Position of trajectory at time t. More...
 
virtual T dx (double t) const
 Velocity of trajectory at time t. More...
 
virtual T ddx (double t) const
 Acceleration of trajectory at time t. More...
 
virtual double duration () const
 Total duration of the trajectory. More...
 
virtual double startTime () const
 Returns the startTime of the trajectory. More...
 
rw::trajectory::TrajectoryIterator< T >::Ptr getIterator (double dt) const
 Returns a bi-directional interator for running through the trajectory. More...
 
- Public Member Functions inherited from Trajectory< T >
virtual ~Trajectory ()
 Destructor.
 
virtual double endTime () const
 Returns the endTime of the trajectory. More...
 
std::vector< T > getPath (double dt, bool uniform=true)
 Constructs a discrete path based on the trajectory. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Trajectory< T >
 Trajectory ()
 Construct an empty trajectory.
 

Detailed Description

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

Combines a number of trajectories.

Takes an arbitrary number of trajectories and combines them. The start time of the first trajectory determines the start time of the union. The remaining trajectories are appended discardless of their start time. The duration of the union corresponds to the sum of the duration of all the trajectories.

The value returned in the transition between two trajectories, corresponds to the end point of the leading trajectory.

Access to a value is O(lg n) with n being the number of trajectories combined.

Constructor & Destructor Documentation

◆ TrajectorySequence() [1/2]

TrajectorySequence ( const std::vector< typename rw::trajectory::Trajectory< T >::Ptr trajectories)
inline

Create a trajectory from trajectories.

Parameters
trajectories[in] Trajectories to join.

◆ TrajectorySequence() [2/2]

TrajectorySequence ( typename rw::trajectory::Trajectory< T >::Ptr  trajectory1,
typename rw::trajectory::Trajectory< T >::Ptr  trajectory2 
)
inline

Create a trajectory from trajectory1 and \ trajectory2.

Parameters
trajectory1[in] First trajectory
trajectory2[in] Second trajectory

Member Function Documentation

◆ ddx()

virtual T ddx ( double  t) const
inlinevirtual

Acceleration of trajectory at time t.

Returns the acceleration of the trajectory at time t \(\in[startTime(), endTime()]\).

Parameters
t[in] time between startTime() and endTime()
Returns
Acceleration

Implements Trajectory< T >.

◆ duration()

virtual double duration ( ) const
inlinevirtual

Total duration of the trajectory.

The duration of the Trajectory corresponds to the time it takes to run through it.

If the trajectory is empty, then -1 is returned.

Implements Trajectory< T >.

◆ dx()

virtual T dx ( double  t) const
inlinevirtual

Velocity of trajectory at time t.

Returns the velocity of the trajectory at time t \(\in[startTime(), endTime()]\).

Parameters
t[in] time between startTime() and endTime()
Returns
Velocity

Implements Trajectory< T >.

◆ getIterator()

rw::trajectory::TrajectoryIterator<T>::Ptr getIterator ( double  dt) const
inlinevirtual

Returns a bi-directional interator for running through the trajectory.

For some trajectory types it may be significantly more efficient to run through using an iterator, rather than using random access.

Parameters
dt[in] The default time step used when using the ++ or – operators in the iterator

Pointer to the iterator. The pointer has ownership.

Implements Trajectory< T >.

◆ startTime()

virtual double startTime ( ) const
inlinevirtual

Returns the startTime of the trajectory.

Returns
Start time

Implements Trajectory< T >.

◆ x()

virtual T x ( double  t) const
inlinevirtual

Position of trajectory at time t.

Returns the position of the trajectory at time t \(\in[startTime(), endTime()]\).

Parameters
t[in] time between startTime() and endTime()
Returns
Position

Implements Trajectory< T >.


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