Robot::Trajectory Class Reference

The representation of a Trajectory. More...

#include <Trajectory.h>

Inheritance diagram for Robot::Trajectory:
Base::Persistence Base::BaseClass

List of all members.

Public Member Functions

void addWaypoint (const Waypoint &WPnt)
void deleteLast (unsigned int n=1)
 delete the last n waypoints
void generateTrajectory (void)
double getDuration (int n=-1) const
 return the duration (s) of the Trajectory if -1 or of the Waypoint with the given number
double getLength (int n=-1) const
 return the Length (mm) of the Trajectory if -1 or of the Waypoint with the given number
virtual unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
Base::Placement getPosition (double time) const
unsigned int getSize (void) const
virtual Base::Type getTypeId (void) const
std::string getUniqueWaypointName (const char *Name) const
double getVelocity (double time) const
const WaypointgetWaypoint (unsigned int pos) const
const std::vector< Waypoint * > & getWaypoints (void) const
Trajectoryoperator= (const Trajectory &)
virtual void Restore (Base::XMLReader &)
 This method is used to restore properties from an XML document.
virtual void Save (Base::Writer &) const
 This method is used to save properties to an XML document.
 Trajectory (const Trajectory &)
 Trajectory ()
 ~Trajectory ()

Static Public Member Functions

static void * create (void)
static Base::Type getClassTypeId (void)
static void init (void)

Protected Attributes

KDL::Trajectory_CompositepcTrajectory
std::vector< Waypoint * > vpcWaypoints

Detailed Description

The representation of a Trajectory.

Definition at line 44 of file Trajectory.h.


Constructor & Destructor Documentation

Trajectory::Trajectory (  ) 

Definition at line 62 of file trajectory.cpp.

Trajectory::Trajectory ( const Trajectory Trac  ) 

Definition at line 68 of file trajectory.cpp.

References operator=().

Trajectory::~Trajectory (  ) 

Definition at line 74 of file trajectory.cpp.

References pcTrajectory, and vpcWaypoints.


Member Function Documentation

void Trajectory::addWaypoint ( const Waypoint WPnt  ) 
void * Robot::Trajectory::create ( void   )  [static]

Reimplemented from Base::Persistence.

Definition at line 60 of file trajectory.cpp.

void Trajectory::deleteLast ( unsigned int  n = 1  ) 

delete the last n waypoints

Definition at line 136 of file trajectory.cpp.

References vpcWaypoints.

Referenced by Robot::TrajectoryPy::deleteLast().

void Trajectory::generateTrajectory ( void   ) 
Base::Type Robot::Trajectory::getClassTypeId ( void   )  [static]

Reimplemented from Base::Persistence.

Definition at line 60 of file trajectory.cpp.

double Trajectory::getDuration ( int  n = -1  )  const
double Trajectory::getLength ( int  n = -1  )  const

return the Length (mm) of the Trajectory if -1 or of the Waypoint with the given number

Definition at line 96 of file trajectory.cpp.

References KDL::Trajectory_Composite::Get(), KDL::Trajectory_Composite::GetPath(), and pcTrajectory.

Referenced by Robot::Simulation::getLength(), and Robot::TrajectoryPy::representation().

unsigned int Trajectory::getMemSize ( void   )  const [virtual]

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?

Implements Base::Persistence.

Definition at line 289 of file trajectory.cpp.

Referenced by Robot::PropertyTrajectory::getMemSize().

Placement Trajectory::getPosition ( double  time  )  const
unsigned int Robot::Trajectory::getSize ( void   )  const [inline]
Base::Type Robot::Trajectory::getTypeId ( void   )  const [virtual]

Reimplemented from Base::Persistence.

Definition at line 60 of file trajectory.cpp.

std::string Trajectory::getUniqueWaypointName ( const char *  Name  )  const

Definition at line 231 of file trajectory.cpp.

References vpcWaypoints.

Referenced by addWaypoint().

double Trajectory::getVelocity ( double  time  )  const
const Waypoint& Robot::Trajectory::getWaypoint ( unsigned int  pos  )  const [inline]
const std::vector<Waypoint*>& Robot::Trajectory::getWaypoints ( void   )  const [inline]

Definition at line 66 of file Trajectory.h.

void Robot::Trajectory::init ( void   )  [static]

Reimplemented from Base::Persistence.

Definition at line 60 of file trajectory.cpp.

Referenced by initRobot().

Trajectory & Trajectory::operator= ( const Trajectory Trac  ) 

Definition at line 81 of file trajectory.cpp.

References generateTrajectory(), and vpcWaypoints.

Referenced by Trajectory().

void Trajectory::Restore ( Base::XMLReader  )  [virtual]

This method is used to restore properties from an XML document.

It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:

 void PropertyVector::Restore(Base::XMLReader &reader)
 {
   // read my Element
   reader.readElement("PropertyVector");
   // get the value of my Attribute
   _cVec.x = (float)reader.getAttributeAsFloat("valueX");
   _cVec.y = (float)reader.getAttributeAsFloat("valueY");
   _cVec.z = (float)reader.getAttributeAsFloat("valueZ");
 }

Implements Base::Persistence.

Definition at line 305 of file trajectory.cpp.

References RobotExampleTrajectoryOutOfShapes::count, generateTrajectory(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::readElement(), Robot::Waypoint::Restore(), and vpcWaypoints.

Referenced by Robot::PropertyTrajectory::Restore().

void Trajectory::Save ( Base::Writer  )  const [virtual]

This method is used to save properties to an XML document.

A good example you'll find in PropertyStandard.cpp, e.g. the vector:

  void PropertyVector::Save (Writer &writer) const
  {
     writer << writer.ind() << "<PropertyVector valueX=\"" <<  _cVec.x <<
                                            "\" valueY=\"" <<  _cVec.y <<
                                            "\" valueZ=\"" <<  _cVec.z <<"\"/>" << endl;
  }

The writer.ind() expression writes the indention, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.

See also:
Base::Writer

Implements Base::Persistence.

Definition at line 294 of file trajectory.cpp.

References Base::Writer::decInd(), getSize(), Base::Writer::incInd(), Base::Writer::ind(), Base::Writer::Stream(), and vpcWaypoints.

Referenced by Robot::PropertyTrajectory::Save().


Member Data Documentation

std::vector<Waypoint*> Robot::Trajectory::vpcWaypoints [protected]

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

Generated on Wed Nov 23 19:02:45 2011 for FreeCAD by  doxygen 1.6.1