00001 /*************************************************************************** 00002 tag: Erwin Aertbelien Mon Jan 10 16:38:39 CET 2005 trajectory_segment.h 00003 00004 trajectory_segment.h - description 00005 ------------------- 00006 begin : Mon January 10 2005 00007 copyright : (C) 2005 Erwin Aertbelien 00008 email : erwin.aertbelien@mech.kuleuven.ac.be 00009 00010 *************************************************************************** 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, * 00024 * Suite 330, Boston, MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 00029 /***************************************************************************** 00030 * \author 00031 * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven 00032 * 00033 * \version 00034 * ORO_Geometry V0.2 00035 * 00036 * \par History 00037 * - $log$ 00038 * 00039 * \par Release 00040 * $Id: trajectory_segment.h,v 1.1.1.1.2.5 2003/07/23 16:44:26 psoetens Exp $ 00041 * $Name: $ 00042 ****************************************************************************/ 00043 00044 #ifndef KDL_MOTION_TRAJECTORY_SEGMENT_H 00045 #define KDL_MOTION_TRAJECTORY_SEGMENT_H 00046 00047 #include "frames.hpp" 00048 #include "frames_io.hpp" 00049 #include "trajectory.hpp" 00050 #include "path.hpp" 00051 #include "velocityprofile.hpp" 00052 00053 00054 namespace KDL { 00055 00056 00062 class Trajectory_Segment : public Trajectory 00063 { 00064 VelocityProfile* motprof; 00065 Path* geom; 00066 bool aggregate; 00067 public: 00071 Trajectory_Segment(Path* _geom, VelocityProfile* _motprof, bool _aggregate=true); 00072 00077 Trajectory_Segment(Path* _geom, VelocityProfile* _motprof, double duration, bool _aggregate=true); 00078 00079 virtual double Duration() const; 00080 // The duration of the trajectory 00081 00082 virtual Frame Pos(double time) const; 00083 // Position of the trajectory at <time>. 00084 00085 virtual Twist Vel(double time) const; 00086 // The velocity of the trajectory at <time>. 00087 virtual Twist Acc(double time) const; 00088 // The acceleration of the trajectory at <time>. 00089 00090 virtual Trajectory* Clone() const 00091 { 00092 if ( aggregate ) 00093 return new Trajectory_Segment( geom->Clone(), motprof->Clone(), true ); 00094 return new Trajectory_Segment( geom, motprof, false ); 00095 } 00096 00097 virtual void Write(std::ostream& os) const; 00098 00099 virtual Path* GetPath(); 00100 00101 virtual VelocityProfile* GetProfile(); 00102 00103 00104 virtual ~Trajectory_Segment(); 00105 }; 00106 00107 00108 00109 } 00110 00111 00112 #endif