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 
53 using namespace std;
54 
56  IOTrace("VelocityProfile::Read");
57  char storage[25];
58  EatWord(is,"[",storage,sizeof(storage));
59  Eat(is,'[');
60  if (strcmp(storage,"DIRACVEL")==0) {
61  Eat(is,']');
62  IOTracePop();
63  return new VelocityProfile_Dirac();
64  } else if (strcmp(storage,"CONSTVEL")==0) {
65  double vel;
66  is >> vel;
67  Eat(is,']');
68  IOTracePop();
69  return new VelocityProfile_Rectangular(vel);
70  } else if (strcmp(storage,"TRAPEZOIDAL")==0) {
71  double maxvel;
72  double maxacc;
73  is >> maxvel;
74  Eat(is,',');
75  is >> maxacc;
76  Eat(is,']');
77  IOTracePop();
78  return new VelocityProfile_Trap(maxvel,maxacc);
79  } else if (strcmp(storage,"TRAPEZOIDALHALF")==0) {
80  double maxvel;
81  double maxacc;
82  is >> maxvel;
83  Eat(is,',');
84  is >> maxacc;
85  Eat(is,',');
86  bool starting;
87  is >> starting;
88  Eat(is,']');
89  IOTracePop();
90  return new VelocityProfile_TrapHalf(maxvel,maxacc,starting);
91  }
92  else {
94  }
95  return 0;
96 }
97 
98 
99 
100 }
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 Tue Sep 1 2020 03:18:51