Simox  2.3.74.0
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 ()
 
const std::vector< Eigen::VectorXf > & getPoints () const
 
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

◆ Trajectory()

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

Construct a trajectory for the given set of RobotNodes

◆ ~Trajectory()

VirtualRobot::Trajectory::~Trajectory ( )
virtual

Member Function Documentation

◆ addPoint()

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

Insert a configuration as one point to the trajectory.

Parameters
cconfiguration vector

◆ clone()

TrajectoryPtr VirtualRobot::Trajectory::clone ( ) const

Creates a copy of the instance.

Returns
pointer to new instance (copy)

◆ createSubPath()

TrajectoryPtr VirtualRobot::Trajectory::createSubPath ( unsigned int  startIndex,
unsigned int  endIndex 
) const

Create a new trajectory from startIndex to endIndex.

◆ createWorkspaceTrajectory()

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.

◆ erasePosition()

void VirtualRobot::Trajectory::erasePosition ( unsigned int  pos)
virtual

Erase a point in trajectory.

Parameters
posposition of point in trajectory array

◆ getData()

const std::vector< Eigen::VectorXf > & VirtualRobot::Trajectory::getData ( ) const

For quick access to data.

◆ getDimension()

unsigned int VirtualRobot::Trajectory::getDimension ( ) const

◆ getLength()

float VirtualRobot::Trajectory::getLength ( ) const
virtual

Returns the euclidean length of the complete trajectory.

Reimplemented in Saba::CSpacePath.

◆ getName()

std::string VirtualRobot::Trajectory::getName ( ) const

◆ getNrOfPoints()

unsigned int VirtualRobot::Trajectory::getNrOfPoints ( ) const

return total number of trajectory points

◆ getPoint()

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

Get a point in trajectory with a index.

Parameters
nrindex to point in trajectory

◆ getPointRef()

Eigen::VectorXf & VirtualRobot::Trajectory::getPointRef ( unsigned int  pos)

◆ getPoints() [1/2]

std::vector< Eigen::VectorXf > const & VirtualRobot::Trajectory::getPoints ( ) const

◆ getPoints() [2/2]

bool VirtualRobot::Trajectory::getPoints ( unsigned int  start,
unsigned int  end,
std::vector< Eigen::VectorXf > &  storePosList 
) const

to retrieve entries of trajectory

◆ getRobotName()

std::string VirtualRobot::Trajectory::getRobotName ( ) const

◆ getRobotNodeSet()

VirtualRobot::RobotNodeSetPtr VirtualRobot::Trajectory::getRobotNodeSet ( )

◆ getVisualization()

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.

◆ insertPosition() [1/2]

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

◆ insertPosition() [2/2]

void VirtualRobot::Trajectory::insertPosition ( unsigned int  pos,
std::vector< Eigen::VectorXf > &  newConfigurations 
)
virtual

◆ insertTrajectory()

void VirtualRobot::Trajectory::insertTrajectory ( unsigned int  pos,
TrajectoryPtr  trajectoryToInsert 
)
virtual

◆ interpolate()

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.

◆ print()

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

prints trajectory contents to console

◆ removePositions()

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

◆ reset()

void VirtualRobot::Trajectory::reset ( )
virtual

reset all data

◆ reverse()

void VirtualRobot::Trajectory::reverse ( )
virtual

reverse position order: end becomes start

◆ toXML()

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

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

Field Documentation

◆ dimension

unsigned int VirtualRobot::Trajectory::dimension
protected

dimension of rns

◆ name

std::string VirtualRobot::Trajectory::name
protected

◆ path

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

vector with configurations which represent the path

◆ rns

RobotNodeSetPtr VirtualRobot::Trajectory::rns
protected