ocra-recipes
Doxygen documentation for the ocra-recipes repository
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ocra::Trajectory Class Reference

#include <Trajectory.h>

Inheritance diagram for ocra::Trajectory:
[legend]
Collaboration diagram for ocra::Trajectory:
[legend]

Public Member Functions

 Trajectory ()
 
void setMaxVelocity (double newMaxVel)
 
void setMaxVelocity (const Eigen::VectorXd &newMaxVel)
 
double getMaxVelocity ()
 
Eigen::VectorXd getMaxVelocityVector ()
 
void setMaxAcceleration (double newMaxAcc)
 
void setMaxAcceleration (const Eigen::VectorXd &newMaxAcc)
 
double getMaxAcceleration ()
 
Eigen::VectorXd getMaxAccelerationVector ()
 
void setWaypoints (const std::vector< double > &startingDoubleVec, const std::vector< double > &endingDoubleVec, const int waypointSelector=0, bool endsWithQuaternion=false)
 
void setWaypoints (const Eigen::VectorXd &startingVector, const Eigen::VectorXd &endingVector, bool endsWithQuaternion=false)
 
void setWaypoints (Eigen::Displacementd &startingDisplacement, Eigen::Displacementd &endingDisplacement, bool endsWithQuaternion=true)
 
void setWaypoints (Eigen::Rotation3d &startingOrientation, Eigen::Rotation3d &endingOrientation, bool endsWithQuaternion=true)
 
void setWaypoints (const std::list< Eigen::VectorXd > &_waypoints, bool _endsWithQuaternion=false)
 
void setWaypoints (Eigen::MatrixXd &waypoints, bool endsWithQuaternion=false)
 
virtual ~Trajectory ()
 
void setDuration ()
 
void setDuration (const Eigen::VectorXd &_pointToPointDurationVector)
 
void setDuration (double time)
 
bool isFinished ()
 
virtual Eigen::MatrixXd getDesiredValues (double time)
 
virtual void getDesiredValues (double time, Eigen::MatrixXd &desiredValues, Eigen::VectorXd &variance)
 
Eigen::MatrixXd getFullTrajectory (double dt=0.01)
 
void getDesiredValues (double time, std::vector< double > &doubleVec)
 
void getDesiredValues (double time, Eigen::Displacementd &disp)
 
void getDesiredValues (double time, Eigen::Rotation3d &orient)
 
void getDesiredValues (double time, Eigen::Displacementd &pos, Eigen::Twistd &vel, Eigen::Twistd &acc)
 
virtual double getDuration ()
 
Eigen::Rotation3d quaternionSlerp (double tau, Eigen::Rotation3d &qStart, Eigen::Rotation3d &qEnd)
 
Eigen::VectorXd displacementToEigenVector (Eigen::Displacementd &disp)
 
Eigen::VectorXd quaternionToEigenVector (Eigen::Rotation3d &quat)
 
bool eigenVectorToStdVector (const Eigen::VectorXd &dispVec, std::vector< double > &doubleVec)
 
bool eigenMatrixToStdVector (const Eigen::MatrixXd &dispMat, std::vector< double > &doubleVec)
 
bool eigenVectorToDisplacement (const Eigen::VectorXd &dispVec, Eigen::Displacementd &disp)
 
bool eigenVectorToQuaternion (const Eigen::VectorXd &quatVec, Eigen::Rotation3d &quat)
 
bool eigenVectorToTwist (const Eigen::VectorXd &twistVec, Eigen::Twistd &twist)
 
virtual void recalculateTrajectory ()
 

Protected Member Functions

virtual void initializeTrajectory ()
 

Protected Attributes

double maximumVelocity
 
Eigen::VectorXd maximumVelocityVector
 
double maximumAcceleration
 
Eigen::VectorXd maximumAccelerationVector
 
std::list< Eigen::VectorXd > waypointList
 
Eigen::MatrixXd waypoints
 
int nDoF
 
int nWaypoints
 
bool endsWithQuaternion
 
bool startTrigger
 
int currentWaypointIndex
 
int nonRotationDof
 
Eigen::VectorXd pointToPointDurationVector
 
double pointToPointDuration
 
double totalTrajectoryDuration
 
bool usingDurationVector
 
bool trajectoryFinished
 

Detailed Description

Definition at line 31 of file Trajectory.h.

Constructor & Destructor Documentation

ocra::Trajectory::Trajectory ( )

The Trajectory class. Constructor function.

Definition at line 18 of file Trajectory.cpp.

ocra::Trajectory::~Trajectory ( )
virtual

Definition at line 25 of file Trajectory.cpp.

Member Function Documentation

Eigen::VectorXd ocra::Trajectory::displacementToEigenVector ( Eigen::Displacementd &  _disp)

Useful auxiliary functions

Convert from a Displacement (double) to and Eigen Vector (double) Stored as [x, y, z, qw, qx, qy, qz]^T

Definition at line 334 of file Trajectory.cpp.

bool ocra::Trajectory::eigenMatrixToStdVector ( const Eigen::MatrixXd &  dispMat,
std::vector< double > &  doubleVec 
)

Definition at line 384 of file Trajectory.cpp.

bool ocra::Trajectory::eigenVectorToDisplacement ( const Eigen::VectorXd &  dispVec,
Eigen::Displacementd &  disp 
)

Definition at line 402 of file Trajectory.cpp.

bool ocra::Trajectory::eigenVectorToQuaternion ( const Eigen::VectorXd &  quatVec,
Eigen::Rotation3d &  quat 
)

Definition at line 435 of file Trajectory.cpp.

bool ocra::Trajectory::eigenVectorToStdVector ( const Eigen::VectorXd &  dispVec,
std::vector< double > &  doubleVec 
)

Definition at line 372 of file Trajectory.cpp.

bool ocra::Trajectory::eigenVectorToTwist ( const Eigen::VectorXd &  twistVec,
Eigen::Twistd &  twist 
)

Definition at line 451 of file Trajectory.cpp.

virtual Eigen::MatrixXd ocra::Trajectory::getDesiredValues ( double  time)
inlinevirtual
virtual void ocra::Trajectory::getDesiredValues ( double  time,
Eigen::MatrixXd &  desiredValues,
Eigen::VectorXd &  variance 
)
inlinevirtual

Reimplemented in ocra::GaussianProcessTrajectory, and ocra::ExperimentalTrajectory.

Definition at line 74 of file Trajectory.h.

void ocra::Trajectory::getDesiredValues ( double  time,
std::vector< double > &  doubleVec 
)

Definition at line 204 of file Trajectory.cpp.

void ocra::Trajectory::getDesiredValues ( double  time,
Eigen::Displacementd &  disp 
)

Definition at line 213 of file Trajectory.cpp.

void ocra::Trajectory::getDesiredValues ( double  time,
Eigen::Rotation3d &  orient 
)

Definition at line 220 of file Trajectory.cpp.

void ocra::Trajectory::getDesiredValues ( double  time,
Eigen::Displacementd &  pos,
Eigen::Twistd &  vel,
Eigen::Twistd &  acc 
)

Definition at line 227 of file Trajectory.cpp.

virtual double ocra::Trajectory::getDuration ( )
inlinevirtual

Reimplemented in ocra::GaussianProcessTrajectory, and ocra::TimeOptimalTrajectory.

Definition at line 89 of file Trajectory.h.

Eigen::MatrixXd ocra::Trajectory::getFullTrajectory ( double  dt = 0.01)

Definition at line 484 of file Trajectory.cpp.

double ocra::Trajectory::getMaxAcceleration ( )

Definition at line 194 of file Trajectory.cpp.

Eigen::VectorXd ocra::Trajectory::getMaxAccelerationVector ( )

Definition at line 199 of file Trajectory.cpp.

double ocra::Trajectory::getMaxVelocity ( )

Definition at line 167 of file Trajectory.cpp.

Eigen::VectorXd ocra::Trajectory::getMaxVelocityVector ( )

Definition at line 172 of file Trajectory.cpp.

virtual void ocra::Trajectory::initializeTrajectory ( )
inlineprotectedvirtual
bool ocra::Trajectory::isFinished ( )
inline

Definition at line 67 of file Trajectory.h.

Eigen::Rotation3d ocra::Trajectory::quaternionSlerp ( double  tau,
Eigen::Rotation3d &  qStart,
Eigen::Rotation3d &  qEnd 
)
Parameters
_tauInterpolation variable, 0 <= tau <= 1. Should be something like time/duration.
_qStartStarting quaternion
_qEndEnding quaternion

Definition at line 241 of file Trajectory.cpp.

Eigen::VectorXd ocra::Trajectory::quaternionToEigenVector ( Eigen::Rotation3d &  quat)

Convert from a Quaternion (double) to and Eigen Vector (double) Stored as [qw, qx, qy, qz]^T

Definition at line 355 of file Trajectory.cpp.

virtual void ocra::Trajectory::recalculateTrajectory ( )
inlinevirtual

Reimplemented in ocra::TimeOptimalTrajectory.

Definition at line 104 of file Trajectory.h.

void ocra::Trajectory::setDuration ( )

Definition at line 284 of file Trajectory.cpp.

void ocra::Trajectory::setDuration ( const Eigen::VectorXd &  _pointToPointDurationVector)

Definition at line 300 of file Trajectory.cpp.

void ocra::Trajectory::setDuration ( double  time)

Definition at line 314 of file Trajectory.cpp.

void ocra::Trajectory::setMaxAcceleration ( double  newMaxAcc)

Definition at line 177 of file Trajectory.cpp.

void ocra::Trajectory::setMaxAcceleration ( const Eigen::VectorXd &  newMaxAcc)

Definition at line 185 of file Trajectory.cpp.

void ocra::Trajectory::setMaxVelocity ( double  newMaxVel)

Definition at line 150 of file Trajectory.cpp.

void ocra::Trajectory::setMaxVelocity ( const Eigen::VectorXd &  newMaxVel)

Definition at line 158 of file Trajectory.cpp.

void ocra::Trajectory::setWaypoints ( const std::vector< double > &  startingDoubleVec,
const std::vector< double > &  endingDoubleVec,
const int  waypointSelector = 0,
bool  endsWithQuaternion = false 
)

Definition at line 30 of file Trajectory.cpp.

void ocra::Trajectory::setWaypoints ( const Eigen::VectorXd &  startingVector,
const Eigen::VectorXd &  endingVector,
bool  endsWithQuaternion = false 
)

Definition at line 58 of file Trajectory.cpp.

void ocra::Trajectory::setWaypoints ( Eigen::Displacementd &  startingDisplacement,
Eigen::Displacementd &  endingDisplacement,
bool  endsWithQuaternion = true 
)

Definition at line 76 of file Trajectory.cpp.

void ocra::Trajectory::setWaypoints ( Eigen::Rotation3d &  startingOrientation,
Eigen::Rotation3d &  endingOrientation,
bool  endsWithQuaternion = true 
)

Definition at line 93 of file Trajectory.cpp.

void ocra::Trajectory::setWaypoints ( const std::list< Eigen::VectorXd > &  _waypoints,
bool  _endsWithQuaternion = false 
)

Initialization function

Definition at line 111 of file Trajectory.cpp.

void ocra::Trajectory::setWaypoints ( Eigen::MatrixXd &  waypoints,
bool  endsWithQuaternion = false 
)

Initialization function

Definition at line 129 of file Trajectory.cpp.

Member Data Documentation

int ocra::Trajectory::currentWaypointIndex
protected

used for keeping track of waypoints during execution

Definition at line 122 of file Trajectory.h.

bool ocra::Trajectory::endsWithQuaternion
protected

weather or not there is a quaternion component of the trajectory - this is needed for interpolation considerations

Definition at line 120 of file Trajectory.h.

double ocra::Trajectory::maximumAcceleration
protected

Definition at line 112 of file Trajectory.h.

Eigen::VectorXd ocra::Trajectory::maximumAccelerationVector
protected

Definition at line 113 of file Trajectory.h.

double ocra::Trajectory::maximumVelocity
protected

Definition at line 108 of file Trajectory.h.

Eigen::VectorXd ocra::Trajectory::maximumVelocityVector
protected

Definition at line 111 of file Trajectory.h.

int ocra::Trajectory::nDoF
protected

the number of Degrees of Freedom (DoF) of the trajectory

Definition at line 118 of file Trajectory.h.

int ocra::Trajectory::nonRotationDof
protected

the number of DoF which are not part of the quaternion

Definition at line 123 of file Trajectory.h.

int ocra::Trajectory::nWaypoints
protected

the total number of waypoints

Definition at line 119 of file Trajectory.h.

double ocra::Trajectory::pointToPointDuration
protected

the total duration between the current two waypoints

Definition at line 127 of file Trajectory.h.

Eigen::VectorXd ocra::Trajectory::pointToPointDurationVector
protected

the estimated durations between points

Definition at line 126 of file Trajectory.h.

bool ocra::Trajectory::startTrigger
protected

used for zeroing the trajectory time

Definition at line 121 of file Trajectory.h.

double ocra::Trajectory::totalTrajectoryDuration
protected

Definition at line 128 of file Trajectory.h.

bool ocra::Trajectory::trajectoryFinished
protected

Definition at line 130 of file Trajectory.h.

bool ocra::Trajectory::usingDurationVector
protected

Definition at line 129 of file Trajectory.h.

std::list<Eigen::VectorXd> ocra::Trajectory::waypointList
protected

Definition at line 116 of file Trajectory.h.

Eigen::MatrixXd ocra::Trajectory::waypoints
protected

the trajectory waypoints

Definition at line 117 of file Trajectory.h.


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