Simox  2.3.74.0
Saba::CSpacePath Class Reference

A path in c-space. More...

Inheritance diagram for Saba::CSpacePath:
VirtualRobot::Trajectory

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW CSpacePath (CSpacePtr cspace, const std::string &name="")
 
 ~CSpacePath () override
 Destructor. More...
 
CSpacePathPtr clone () const
 
CSpacePathPtr createSubPath (unsigned int startIndex, unsigned int endIndex) const
 
float getLength () const override
 
float getLength (bool useCSpaceWeights) const
 
float getLength (unsigned int startIndex, unsigned int endIndex, bool useCSpaceWeights=true) const
 
void interpolate (float t, Eigen::VectorXf &storePos, int *storeIndex=NULL) const override
 
virtual float getTime (unsigned int nr)
 return time t (0<=t<=1) for path entry with number nr More...
 
CSpacePtr getCSpace ()
 
std::vector< Eigen::Matrix4f > createWorkspacePath (VirtualRobot::RobotNodePtr r=VirtualRobot::RobotNodePtr())
 
- Public Member Functions inherited from VirtualRobot::Trajectory
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)
 
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

CSpacePtr cspace
 
- Protected Attributes inherited from VirtualRobot::Trajectory
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 path in c-space.

Constructor & Destructor Documentation

◆ CSpacePath()

Saba::CSpacePath::CSpacePath ( CSpacePtr  cspace,
const std::string &  name = "" 
)

Constructor. Dimension of this path is retrieved from cspace.

Parameters
cspaceIs used to retrieve the dimension of the corresponding c-space and the corresponding joints
nameAn optional string, identifying this path.

◆ ~CSpacePath()

Saba::CSpacePath::~CSpacePath ( )
override

Destructor.

Member Function Documentation

◆ clone()

CSpacePathPtr Saba::CSpacePath::clone ( ) const

Creates a copy of the path instance.

Returns
pointer to new instance (copy)

◆ createSubPath()

CSpacePathPtr Saba::CSpacePath::createSubPath ( unsigned int  startIndex,
unsigned int  endIndex 
) const

◆ createWorkspacePath()

std::vector< Eigen::Matrix4f > Saba::CSpacePath::createWorkspacePath ( VirtualRobot::RobotNodePtr  r = VirtualRobot::RobotNodePtr())

◆ getCSpace()

Saba::CSpacePtr Saba::CSpacePath::getCSpace ( )

◆ getLength() [1/3]

float Saba::CSpacePath::getLength ( ) const
overridevirtual

Return euclidean c-space length of complete path. Any weights that may be defined in the corresponding c-space are considered.

Reimplemented from VirtualRobot::Trajectory.

◆ getLength() [2/3]

float Saba::CSpacePath::getLength ( bool  useCSpaceWeights) const

Return euclidean c-space length of complete path

Parameters
useCSpaceWeightsWhen set, the weight that might have been specified in the corresponding c-space are used for computing the path length.

◆ getLength() [3/3]

float Saba::CSpacePath::getLength ( unsigned int  startIndex,
unsigned int  endIndex,
bool  useCSpaceWeights = true 
) const

Return length of part of the path (in CSpace!)

Parameters
startIndexThe start point
endIndexThe end point
useCSpaceWeightsWhen set, the weights that have been specified in the corresponding c-space are used for computing the path length.

◆ getTime()

float Saba::CSpacePath::getTime ( unsigned int  nr)
virtual

return time t (0<=t<=1) for path entry with number nr

◆ interpolate()

void Saba::CSpacePath::interpolate ( float  t,
Eigen::VectorXf &  storePos,
int *  storeIndex = NULL 
) const
overridevirtual

return position on path for time t (0<=t<=1) If storeIndex!=NULL the index of the last path point is stored. This method consideres weighting of c-space dimensions!

Reimplemented from VirtualRobot::Trajectory.

Field Documentation

◆ cspace

CSpacePtr Saba::CSpacePath::cspace
protected