orocos_kdl
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 
63 class VelocityProfile_TrapHalf : public VelocityProfile
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
KDL::VelocityProfile_TrapHalf::Pos
virtual double Pos(double time) const
Definition: velocityprofile_traphalf.cpp:182
KDL::VelocityProfile_TrapHalf::duration
double duration
Definition: velocityprofile_traphalf.hpp:149
velocityprofile.hpp
KDL::VelocityProfile_TrapHalf::SetProfile
virtual void SetProfile(double pos1, double pos2)
Definition: velocityprofile_traphalf.cpp:120
KDL::VelocityProfile_TrapHalf::b1
double b1
Definition: velocityprofile_traphalf.hpp:147
KDL::VelocityProfile_TrapHalf::VelocityProfile_TrapHalf
VelocityProfile_TrapHalf(double _maxvel=0, double _maxacc=0, bool _starting=true)
Definition: velocityprofile_traphalf.cpp:88
KDL::VelocityProfile_TrapHalf::starting
bool starting
Definition: velocityprofile_traphalf.hpp:158
KDL::VelocityProfile_TrapHalf::c1
double c1
Definition: velocityprofile_traphalf.hpp:148
KDL::VelocityProfile_TrapHalf::~VelocityProfile_TrapHalf
virtual ~VelocityProfile_TrapHalf()
Definition: velocityprofile_traphalf.cpp:229
KDL::VelocityProfile_TrapHalf::Acc
virtual double Acc(double time) const
Definition: velocityprofile_traphalf.cpp:209
KDL::VelocityProfile_TrapHalf::Duration
virtual double Duration() const
Definition: velocityprofile_traphalf.cpp:178
KDL::VelocityProfile_TrapHalf::Clone
virtual VelocityProfile * Clone() const
Definition: velocityprofile_traphalf.cpp:223
KDL::VelocityProfile_TrapHalf::SetMax
void SetMax(double _maxvel, double _maxacc, bool _starting)
Definition: velocityprofile_traphalf.cpp:91
KDL
Definition: kukaLWR_DHnew.cpp:25
KDL::VelocityProfile_TrapHalf::a2
double a2
Definition: velocityprofile_traphalf.hpp:146
KDL::VelocityProfile_TrapHalf::endpos
double endpos
Definition: velocityprofile_traphalf.hpp:153
KDL::VelocityProfile_TrapHalf::Write
virtual void Write(std::ostream &os) const
Definition: velocityprofile_traphalf.cpp:232
KDL::VelocityProfile_TrapHalf::maxvel
double maxvel
Definition: velocityprofile_traphalf.hpp:156
KDL::VelocityProfile_TrapHalf::PlanProfile1
void PlanProfile1(double v, double a)
Definition: velocityprofile_traphalf.cpp:96
KDL::VelocityProfile_TrapHalf::startpos
double startpos
Definition: velocityprofile_traphalf.hpp:152
std::ostream
KDL::VelocityProfile_TrapHalf::PlanProfile2
void PlanProfile2(double v, double a)
Definition: velocityprofile_traphalf.cpp:108
KDL::VelocityProfile_TrapHalf::Vel
virtual double Vel(double time) const
Definition: velocityprofile_traphalf.cpp:195
KDL::VelocityProfile_TrapHalf::b2
double b2
Definition: velocityprofile_traphalf.hpp:147
KDL::VelocityProfile_TrapHalf::a3
double a3
Definition: velocityprofile_traphalf.hpp:146
KDL::VelocityProfile_TrapHalf::t1
double t1
Definition: velocityprofile_traphalf.hpp:150
KDL::VelocityProfile_TrapHalf::c2
double c2
Definition: velocityprofile_traphalf.hpp:148
KDL::VelocityProfile_TrapHalf::maxacc
double maxacc
Definition: velocityprofile_traphalf.hpp:157
KDL::VelocityProfile_TrapHalf::b3
double b3
Definition: velocityprofile_traphalf.hpp:147
KDL::VelocityProfile_TrapHalf::t2
double t2
Definition: velocityprofile_traphalf.hpp:150
KDL::VelocityProfile_TrapHalf::c3
double c3
Definition: velocityprofile_traphalf.hpp:148
KDL::VelocityProfile_TrapHalf::SetProfileDuration
virtual void SetProfileDuration(double pos1, double pos2, double newduration)
Definition: velocityprofile_traphalf.cpp:138
KDL::VelocityProfile_TrapHalf::a1
double a1
Definition: velocityprofile_traphalf.hpp:146