velocityprofile_trap.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Erwin Aertbelien Mon Jan 10 16:38:38 CET 2005 velocityprofile_trap.h
3 
4  velocityprofile_trap.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_trap.h,v 1.1.1.1.2.5 2003/07/24 13:26:15 psoetens Exp $
41  * $Name: $
42  ****************************************************************************/
43 
44 #ifndef KDL_MOTION_VELOCITYPROFILE_TRAP_H
45 #define KDL_MOTION_VELOCITYPROFILE_TRAP_H
46 
47 #include "velocityprofile.hpp"
48 
49 
50 
51 
52 namespace KDL {
53 
54 
55 
61  {
62  // For "running" a motion profile :
63  double a1,a2,a3; // coef. from ^0 -> ^2 of first part
64  double b1,b2,b3; // of 2nd part
65  double c1,c2,c3; // of 3rd part
66  double duration;
67  double t1,t2;
68 
69  // specification of the motion profile :
70  double maxvel;
71  double maxacc;
72  double startpos;
73  double endpos;
74  public:
75 
76  VelocityProfile_Trap(double _maxvel=0,double _maxacc=0);
77  // constructs motion profile class with <maxvel> and <maxacc> as parameters of the
78  // trajectory.
79 
80  virtual void SetProfile(double pos1,double pos2);
81 
82  virtual void SetProfileDuration(
83  double pos1,double pos2,double newduration
84  );
85 
94  virtual void SetProfileVelocity(
95  double pos1,double pos2,double newvelocity
96  );
97 
98  virtual void SetMax(double _maxvel,double _maxacc);
99  virtual double Duration() const;
100  virtual double Pos(double time) const;
101  virtual double Vel(double time) const;
102  virtual double Acc(double time) const;
103  virtual void Write(std::ostream& os) const;
104  virtual VelocityProfile* Clone() const;
105  // returns copy of current VelocityProfile object. (virtual constructor)
106  virtual ~VelocityProfile_Trap();
107  };
108 
109 
110 
111 
112 
113 
114 /* Niet OK
115  class VelocityProfile_Trap : public VelocityProfile {
116  double maxvel;
117  double maxacc;
118  double _t1,_t2,_T,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10;
119 
120  void PrepTraj(double p1,double v1,double p2,double v2,
121  double acc,double vel,double t1,double t2,double T);
122  // Internal method. Sets the parameters <_t1>,..<c10> with the given
123  // arguments.
124  public:
125  VelocityProfile_Trap(double _maxvel,double _maxacc):
126  maxvel(_maxvel),maxacc(_maxacc) {}
127  // constructs motion profile class with max velocity <maxvel>,
128  // and max acceleration <maxacc> as parameter of the
129  // trajectory.
130 
131  void SetProfile(double pos1,double pos2);
132  virtual void SetProfileDuration(double pos1,double pos2,double duration);
133  virtual double Duration() ;
134  virtual double Pos(double time);
135  virtual double Vel(double time);
136  };
137 */
138 
139 }
140 
141 
142 #endif
virtual double Vel(double time) const
virtual double Pos(double time) const
VelocityProfile_Trap(double _maxvel=0, double _maxacc=0)
virtual double Acc(double time) const
virtual void Write(std::ostream &os) const
virtual void SetProfileDuration(double pos1, double pos2, double newduration)
virtual void SetProfileVelocity(double pos1, double pos2, double newvelocity)
virtual void SetMax(double _maxvel, double _maxacc)
virtual void SetProfile(double pos1, double pos2)
virtual VelocityProfile * Clone() const
virtual double Duration() const


orocos_kdl
Author(s):
autogenerated on Sun Nov 22 2020 03:16:44