RobWorkProject
24.8.23-
|
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. | |
Interface for Trajectories in RobWork.
|
pure virtual |
Acceleration of trajectory at time t.
Returns the acceleration of the trajectory at time t \(\in[startTime(), endTime()]\).
t | [in] time between startTime() and endTime() |
Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, BlendedTrajectory< T >, and BlendedTrajectory< U >.
|
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 >, BlendedTrajectory< T >, and BlendedTrajectory< U >.
|
pure virtual |
Velocity of trajectory at time t.
Returns the velocity of the trajectory at time t \(\in[startTime(), endTime()]\).
t | [in] time between startTime() and endTime() |
Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, BlendedTrajectory< T >, and BlendedTrajectory< U >.
|
inlinevirtual |
Returns the endTime of the trajectory.
The end time equals startTime() + duration().
Reimplemented in BlendedTrajectory< T >, and BlendedTrajectory< U >.
|
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.
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 >, TrajectorySequence< T >, TrajectorySequence< U >, BlendedTrajectory< T >, and BlendedTrajectory< U >.
|
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.
dt | [in] Step size |
uniform | [in] Whether to sample the path uniformly |
|
pure virtual |
Returns the startTime of the trajectory.
Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, BlendedTrajectory< T >, and BlendedTrajectory< U >.
|
pure virtual |
Position of trajectory at time t.
Returns the position of the trajectory at time t \(\in[startTime(), endTime()]\).
t | [in] time between startTime() and endTime() |
Implemented in TrajectorySequence< T >, TrajectorySequence< U >, InterpolatorTrajectory< T >, InterpolatorTrajectory< U >, BlendedTrajectory< T >, and BlendedTrajectory< U >.