KDL  1.4.0
velocityprofile_traphalf.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Erwin Aertbelien Mon Jan 10 16:38:38 CET 2005 velocityprofile_traphalf.h
3 
4  velocityprofile_traphalf.h - description
5  -------------------
6  begin : Mon January 10 2005
7  copyright : (C) 2005 Erwin Aertbelien
8  email : erwin.aertbelien@mech.kuleuven.ac.be
9 
10  ***************************************************************************
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU Lesser General Public *
13  * License as published by the Free Software Foundation; either *
14  * version 2.1 of the License, or (at your option) any later version. *
15  * *
16  * This library is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19  * Lesser General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU Lesser General Public *
22  * License along with this library; if not, write to the Free Software *
23  * Foundation, Inc., 59 Temple Place, *
24  * Suite 330, Boston, MA 02111-1307 USA *
25  * *
26  ***************************************************************************/
27 
28 
29 /*****************************************************************************
30  * \author
31  * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
32  *
33  * \version
34  * ORO_Geometry V0.2
35  *
36  * \par History
37  * - $log$
38  *
39  * \par Release
40  * $Id: velocityprofile_traphalf.h,v 1.1.1.1.2.4 2003/07/24 13:26:15 psoetens Exp $
41  * $Name: $
42  * \par Status
43  * Experimental
44  ****************************************************************************/
45 
46 #ifndef KDL_MOTION_VELOCITYPROFILE_TRAPHALF_H
47 #define KDL_MOTION_VELOCITYPROFILE_TRAPHALF_H
48 
49 #include "velocityprofile.hpp"
50 
51 
52 
53 
54 namespace KDL {
55 
56 
64  {
65  // For "running" a motion profile :
66  double a1,a2,a3; // coef. from ^0 -> ^2 of first part
67  double b1,b2,b3; // of 2nd part
68  double c1,c2,c3; // of 3rd part
69  double duration;
70  double t1,t2;
71 
72  double startpos;
73  double endpos;
74 
75  // Persistent state :
76  double maxvel;
77  double maxacc;
78  bool starting;
79 
80  void PlanProfile1(double v,double a);
81  void PlanProfile2(double v,double a);
82  public:
83 
90  VelocityProfile_TrapHalf(double _maxvel=0,double _maxacc=0,bool _starting=true);
91 
92  void SetMax(double _maxvel,double _maxacc,bool _starting);
93 
104  virtual void SetProfile(double pos1,double pos2);
105 
117  virtual void SetProfileDuration(
118  double pos1,double pos2,double newduration
119  );
120 
121  virtual double Duration() const;
122  virtual double Pos(double time) const;
123  virtual double Vel(double time) const;
124  virtual double Acc(double time) const;
125  virtual void Write(std::ostream& os) const;
126  virtual VelocityProfile* Clone() const;
127 
128  virtual ~VelocityProfile_TrapHalf();
129  };
130 
131 
132 
133 }
134 
135 
136 #endif
double duration
Definition: velocityprofile_traphalf.hpp:69
double a2
Definition: velocityprofile_traphalf.hpp:66
double b3
Definition: velocityprofile_traphalf.hpp:67
double endpos
Definition: velocityprofile_traphalf.hpp:73
virtual double Pos(double time) const
Definition: velocityprofile_traphalf.cpp:144
double startpos
Definition: velocityprofile_traphalf.hpp:72
VelocityProfile_TrapHalf(double _maxvel=0, double _maxacc=0, bool _starting=true)
Definition: velocityprofile_traphalf.cpp:50
virtual VelocityProfile * Clone() const
Definition: velocityprofile_traphalf.cpp:185
virtual ~VelocityProfile_TrapHalf()
Definition: velocityprofile_traphalf.cpp:191
void PlanProfile2(double v, double a)
Definition: velocityprofile_traphalf.cpp:70
double c2
Definition: velocityprofile_traphalf.hpp:68
double a3
Definition: velocityprofile_traphalf.hpp:66
double a1
Definition: velocityprofile_traphalf.hpp:66
double c3
Definition: velocityprofile_traphalf.hpp:68
Definition: articulatedbodyinertia.cpp:28
double c1
Definition: velocityprofile_traphalf.hpp:68
virtual double Acc(double time) const
Definition: velocityprofile_traphalf.cpp:171
A 'Half' Trapezoidal VelocityProfile.
Definition: velocityprofile_traphalf.hpp:63
A VelocityProfile stores the velocity profile that is used within a trajectory.
Definition: velocityprofile.hpp:62
virtual void Write(std::ostream &os) const
Definition: velocityprofile_traphalf.cpp:194
double t2
Definition: velocityprofile_traphalf.hpp:70
virtual void SetProfile(double pos1, double pos2)
Plans a 'Half' Trapezoidal VelocityProfile between pos1 and pos2.
Definition: velocityprofile_traphalf.cpp:82
double b1
Definition: velocityprofile_traphalf.hpp:67
double maxvel
Definition: velocityprofile_traphalf.hpp:76
double b2
Definition: velocityprofile_traphalf.hpp:67
void SetMax(double _maxvel, double _maxacc, bool _starting)
Definition: velocityprofile_traphalf.cpp:53
virtual void SetProfileDuration(double pos1, double pos2, double newduration)
Can be used to prolong the profile, there are two possible outcomes: in a first phase the acceleratio...
Definition: velocityprofile_traphalf.cpp:100
bool starting
Definition: velocityprofile_traphalf.hpp:78
virtual double Vel(double time) const
Definition: velocityprofile_traphalf.cpp:157
virtual double Duration() const
Definition: velocityprofile_traphalf.cpp:140
double maxacc
Definition: velocityprofile_traphalf.hpp:77
void PlanProfile1(double v, double a)
Definition: velocityprofile_traphalf.cpp:58
double t1
Definition: velocityprofile_traphalf.hpp:70