RobWorkProject  23.9.11-
Public Types | Public Member Functions | Protected Member Functions | List of all members
Trajectory< T > Class Template Referenceabstract

Interface for Trajectories in RobWork. More...

#include <Trajectory.hpp>

Inherited by InterpolatorTrajectory< T >, and TrajectorySequence< T >.

Public Types

typedef rw::core::Ptr< Trajectory< T > > Ptr
 smart pointer type
 

Public Member Functions

virtual ~Trajectory ()
 Destructor.
 
virtual T x (double t) const =0
 Position of trajectory at time t. More...
 
virtual T dx (double t) const =0
 Velocity of trajectory at time t. More...
 
virtual T ddx (double t) const =0
 Acceleration of trajectory at time t. More...
 
virtual double duration () const =0
 Total duration of the trajectory. More...
 
virtual double startTime () const =0
 Returns the startTime of the trajectory. More...
 
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...
 
virtual rw::trajectory::TrajectoryIterator< T >::Ptr getIterator (double dt=1) const =0
 Returns a bi-directional interator for running through the trajectory. More...
 

Protected Member Functions

 Trajectory ()
 Construct an empty trajectory.
 

Detailed Description

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

Interface for Trajectories in RobWork.

Member Function Documentation

◆ ddx()

virtual T ddx ( double  t) const
pure virtual

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

Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, InterpolatorTrajectory< rw::math::Q >, DeviceTrajectory, BlendedTrajectory< T >, and BlendedTrajectory< U >.

◆ duration()

virtual double duration ( ) const
pure virtual

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.

Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, InterpolatorTrajectory< rw::math::Q >, DeviceTrajectory, BlendedTrajectory< T >, and BlendedTrajectory< U >.

◆ dx()

virtual T dx ( double  t) const
pure virtual

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

Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, InterpolatorTrajectory< rw::math::Q >, DeviceTrajectory, BlendedTrajectory< T >, and BlendedTrajectory< U >.

◆ endTime()

virtual double endTime ( ) const
inlinevirtual

Returns the endTime of the trajectory.

The end time equals startTime() + duration().

Returns
The end time

Reimplemented in DeviceTrajectory, BlendedTrajectory< T >, and BlendedTrajectory< U >.

◆ getIterator()

virtual rw::trajectory::TrajectoryIterator<T>::Ptr getIterator ( double  dt = 1) const
pure virtual

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.

Implemented in InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, InterpolatorTrajectory< rw::math::Q >, TrajectorySequence< T >, TrajectorySequence< U >, DeviceTrajectory, BlendedTrajectory< T >, and BlendedTrajectory< U >.

◆ getPath()

std::vector<T> getPath ( double  dt,
bool  uniform = true 
)
inline

Constructs a discrete path based on the trajectory.

If uniform = true the path will be divided into the smallest number of uniform steps for which the time stepsize <= dt.

If uniform = false the path is divided into steps of duration dt, except the last interval which may be shorter to include the end point.

Parameters
dt[in] Step size
uniform[in] Whether to sample the path uniformly
Returns
The discrete path.

◆ startTime()

virtual double startTime ( ) const
pure virtual

◆ x()

virtual T x ( double  t) const
pure virtual

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

Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, InterpolatorTrajectory< rw::math::Q >, DeviceTrajectory, BlendedTrajectory< T >, and BlendedTrajectory< U >.


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