Simox  2.3.50
VirtualRobot::Trajectory Class Reference
Inheritance diagram for VirtualRobot::Trajectory:
Saba::CSpacePath

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW Trajectory (RobotNodeSetPtr rns, const std::string &name="")
 
virtual ~Trajectory ()
 
std::vector< Eigen::VectorXf > getPoints ()
 
void addPoint (const Eigen::VectorXf &c)
 
Eigen::VectorXf getPoint (unsigned int nr) const
 
unsigned int getNrOfPoints () const
 return total number of trajectory points More...
 
bool getPoints (unsigned int start, unsigned int end, std::vector< Eigen::VectorXf > &storePosList) const
 to retrieve entries of trajectory More...
 
TrajectoryPtr clone () const
 
TrajectoryPtr createSubPath (unsigned int startIndex, unsigned int endIndex) const
 
virtual void reset ()
 reset all data More...
 
virtual void reverse ()
 reverse position order: end becomes start More...
 
virtual void erasePosition (unsigned int pos)
 
virtual unsigned int removePositions (unsigned int startPos, unsigned int endPos)
 
virtual void insertPosition (unsigned int pos, const Eigen::VectorXf &c)
 
virtual void insertPosition (unsigned int pos, std::vector< Eigen::VectorXf > &newConfigurations)
 
virtual void insertTrajectory (unsigned int pos, TrajectoryPtr trajectoryToInsert)
 
virtual float getLength () const
 
virtual void interpolate (float t, Eigen::VectorXf &storePos, int *storeIndex=NULL) const
 
unsigned int getDimension () const
 
virtual void print () const
 prints trajectory contents to console More...
 
const std::vector< Eigen::VectorXf > & getData () const
 For quick access to data. More...
 
Eigen::VectorXf & getPointRef (unsigned int pos)
 
VirtualRobot::RobotNodeSetPtr getRobotNodeSet ()
 
std::vector< Eigen::Matrix4f > createWorkspaceTrajectory (VirtualRobot::RobotNodePtr r=VirtualRobot::RobotNodePtr())
 
virtual std::string toXML (int tabs=0) const
 
std::string getName () const
 
std::string getRobotName () const
 
VisualizationNodePtr getVisualization (std::string visualizationFactoryName="")
 

Protected Attributes

std::vector< Eigen::VectorXf > path
 vector with configurations which represent the path More...
 
RobotNodeSetPtr rns
 
std::string name
 
unsigned int dimension
 dimension of rns More...
 

Detailed Description

A representation of a trajectory in joint space, associated with a RobotNodeSet.

Constructor & Destructor Documentation

VirtualRobot::Trajectory::Trajectory ( RobotNodeSetPtr  rns,
const std::string &  name = "" 
)

Construct a trajectory for the given set of RobotNodes

VirtualRobot::Trajectory::~Trajectory ( )
virtual

Member Function Documentation

void VirtualRobot::Trajectory::addPoint ( const Eigen::VectorXf &  c)

Insert a configuration as one point to the trajectory.

Parameters
cconfiguration vector
TrajectoryPtr VirtualRobot::Trajectory::clone ( ) const

Creates a copy of the instance.

Returns
pointer to new instance (copy)
TrajectoryPtr VirtualRobot::Trajectory::createSubPath ( unsigned int  startIndex,
unsigned int  endIndex 
) const

Create a new trajectory from startIndex to endIndex.

std::vector< Eigen::Matrix4f > VirtualRobot::Trajectory::createWorkspaceTrajectory ( VirtualRobot::RobotNodePtr  r = VirtualRobot::RobotNodePtr())

Creates the corresponding trajectory in workspace.

Parameters
rThe RobotNode that should be considered (if not set, the TCP of the RobotNodeSet is used)
Returns
For each point of this joint space trajectory, the pose of r in workspace is computed and added to the resulting vector.
void VirtualRobot::Trajectory::erasePosition ( unsigned int  pos)
virtual

Erase a point in trajectory.

Parameters
posposition of point in trajectory array
const std::vector< Eigen::VectorXf > & VirtualRobot::Trajectory::getData ( ) const

For quick access to data.

unsigned int VirtualRobot::Trajectory::getDimension ( ) const
float VirtualRobot::Trajectory::getLength ( ) const
virtual

Returns the euclidean length of the complete trajectory.

Reimplemented in Saba::CSpacePath.

std::string VirtualRobot::Trajectory::getName ( ) const
unsigned int VirtualRobot::Trajectory::getNrOfPoints ( ) const

return total number of trajectory points

Eigen::VectorXf VirtualRobot::Trajectory::getPoint ( unsigned int  nr) const

Get a point in trajectory with a index.

Parameters
nrindex to point in trajectory
Eigen::VectorXf & VirtualRobot::Trajectory::getPointRef ( unsigned int  pos)
std::vector<Eigen::VectorXf> VirtualRobot::Trajectory::getPoints ( )
bool VirtualRobot::Trajectory::getPoints ( unsigned int  start,
unsigned int  end,
std::vector< Eigen::VectorXf > &  storePosList 
) const

to retrieve entries of trajectory

std::string VirtualRobot::Trajectory::getRobotName ( ) const
VirtualRobot::RobotNodeSetPtr VirtualRobot::Trajectory::getRobotNodeSet ( )
VisualizationNodePtr VirtualRobot::Trajectory::getVisualization ( std::string  visualizationFactoryName = "")

Get a visualization for this trajectory.

Parameters
visualizationFactoryNameThe string that identifies the factory. If not given, the first registered factory (which is usually the only one) is used.
void VirtualRobot::Trajectory::insertPosition ( unsigned int  pos,
const Eigen::VectorXf &  c 
)
virtual

Insert a point into trajectory.

Parameters
posposition of point being inserted
cconfiguration / valid joint values to insert as a point in trajectory
void VirtualRobot::Trajectory::insertPosition ( unsigned int  pos,
std::vector< Eigen::VectorXf > &  newConfigurations 
)
virtual
void VirtualRobot::Trajectory::insertTrajectory ( unsigned int  pos,
TrajectoryPtr  trajectoryToInsert 
)
virtual
void VirtualRobot::Trajectory::interpolate ( float  t,
Eigen::VectorXf &  storePos,
int *  storeIndex = NULL 
) const
virtual

return position on trajectory for time t (0<=t<=1) If storeIndex!=NULL the index of the last trajectory point is stored

Reimplemented in Saba::CSpacePath.

void VirtualRobot::Trajectory::print ( ) const
virtual

prints trajectory contents to console

unsigned int VirtualRobot::Trajectory::removePositions ( unsigned int  startPos,
unsigned int  endPos 
)
virtual

Erases all points from start to end in trajectory (including start&end).

Parameters
startPosstart position of point in trajectory array
endPosend position of point in trajectory array
void VirtualRobot::Trajectory::reset ( )
virtual

reset all data

void VirtualRobot::Trajectory::reverse ( )
virtual

reverse position order: end becomes start

std::string VirtualRobot::Trajectory::toXML ( int  tabs = 0) const
virtual

Create an XML string. All lines are indented with tabs tab stops.

Field Documentation

unsigned int VirtualRobot::Trajectory::dimension
protected

dimension of rns

std::string VirtualRobot::Trajectory::name
protected
std::vector< Eigen::VectorXf > VirtualRobot::Trajectory::path
protected

vector with configurations which represent the path

RobotNodeSetPtr VirtualRobot::Trajectory::rns
protected