velocityprofile.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Erwin Aertbelien Mon May 10 19:10:36 CEST 2004 velocityprofile.cxx
3 
4  velocityprofile.cxx - description
5  -------------------
6  begin : Mon May 10 2004
7  copyright : (C) 2004 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  * \author
29  * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
30  *
31  * \version
32  * ORO_Geometry V0.2
33  *
34  * \par History
35  * - $log$
36  *
37  * \par Release
38  * $Id: velocityprofile.cpp,v 1.1.1.1.2.3 2003/02/24 13:13:06 psoetens Exp $
39  * $Name: $
40  ****************************************************************************/
41 
42 
43 #include "utilities/error.h"
44 #include "utilities/error_stack.h"
45 #include "velocityprofile_rect.hpp"
47 #include "velocityprofile_trap.hpp"
49 #include <string.h>
50 
51 namespace KDL {
52 
54  IOTrace("VelocityProfile::Read");
55  char storage[25];
56  EatWord(is,"[",storage,sizeof(storage));
57  Eat(is,'[');
58  if (strcmp(storage,"DIRACVEL")==0) {
59  Eat(is,']');
60  IOTracePop();
61  return new VelocityProfile_Dirac();
62  } else if (strcmp(storage,"CONSTVEL")==0) {
63  double vel;
64  is >> vel;
65  Eat(is,']');
66  IOTracePop();
67  return new VelocityProfile_Rectangular(vel);
68  } else if (strcmp(storage,"TRAPEZOIDAL")==0) {
69  double maxvel;
70  double maxacc;
71  is >> maxvel;
72  Eat(is,',');
73  is >> maxacc;
74  Eat(is,']');
75  IOTracePop();
76  return new VelocityProfile_Trap(maxvel,maxacc);
77  } else if (strcmp(storage,"TRAPEZOIDALHALF")==0) {
78  double maxvel;
79  double maxacc;
80  is >> maxvel;
81  Eat(is,',');
82  is >> maxacc;
83  Eat(is,',');
84  bool starting;
85  is >> starting;
86  Eat(is,']');
87  IOTracePop();
88  return new VelocityProfile_TrapHalf(maxvel,maxacc,starting);
89  }
90  else {
92  }
93  return 0;
94 }
95 
96 }
void IOTracePop()
pops a description of the IO-stack
void EatWord(std::istream &is, const char *delim, char *storage, int maxsize)
static VelocityProfile * Read(std::istream &is)
void Eat(std::istream &is, int delim)
void IOTrace(const std::string &description)


orocos_kdl
Author(s):
autogenerated on Fri Oct 22 2021 02:16:49