00001 /***************************************************************************** 00002 * \author 00003 * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven 00004 * 00005 * \version 00006 * LRL V0.2 00007 * 00008 * \par History 00009 * - $log$ 00010 * 00011 * \par Release 00012 * $Id: trajectory_composite.h 22 2004-09-21 08:58:54Z eaertbellocal $ 00013 * $Name: $ 00014 ****************************************************************************/ 00015 00016 00017 #ifndef TRAJECTORY_COMPOSITE_H 00018 #define TRAJECTORY_COMPOSITE_H 00019 00020 #include "trajectory.hpp" 00021 #include "path_composite.hpp" 00022 #include <vector> 00023 00024 00025 00026 namespace KDL { 00032 class Trajectory_Composite: public Trajectory 00033 { 00034 typedef std::vector<Trajectory*> VectorTraj; 00035 typedef std::vector<double> VectorDouble; 00036 VectorTraj vt; // contains the element Trajectories 00037 VectorDouble vd; // contains end time for each Trajectory 00038 double duration; // total duration of the composed 00039 // Trajectory 00040 Path_Composite* path; 00041 00042 public: 00043 Trajectory_Composite(); 00044 // Constructs an empty composite 00045 00046 virtual double Duration() const; 00047 virtual Frame Pos(double time) const; 00048 virtual Twist Vel(double time) const; 00049 virtual Twist Acc(double time) const; 00050 00051 virtual void Add(Trajectory* elem); 00052 // Adds trajectory <elem> to the end of the sequence. 00053 00054 virtual void Destroy(); 00055 virtual void Write(std::ostream& os) const; 00056 virtual Trajectory* Clone() const; 00057 virtual Path* GetPath(); 00058 virtual VelocityProfile* GetProfile(); 00059 00060 // access the single members 00061 Trajectory *Get(unsigned int n){return vt[n];} 00062 00063 virtual ~Trajectory_Composite(); 00064 }; 00065 00066 00067 } 00068 00069 #endif