orocos_kdl
src
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
"
46
#include "
velocityprofile_dirac.hpp
"
47
#include "
velocityprofile_trap.hpp
"
48
#include "
velocityprofile_traphalf.hpp
"
49
#include <string.h>
50
51
namespace
KDL
{
52
53
VelocityProfile*
VelocityProfile::Read
(
std::istream
& is) {
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
{
91
throw
Error_MotionIO_Unexpected_MotProf
();
92
}
93
return
0;
94
}
95
96
}
std::strcmp
T strcmp(T... args)
velocityprofile_dirac.hpp
velocityprofile_trap.hpp
KDL::VelocityProfile::Read
static VelocityProfile * Read(std::istream &is)
Definition:
velocityprofile.cpp:91
KDL
Definition:
kukaLWR_DHnew.cpp:25
KDL::Error_MotionIO_Unexpected_MotProf
Definition:
error.h:191
velocityprofile_rect.hpp
KDL::IOTrace
void IOTrace(const std::string &description)
Definition:
error_stack.cxx:46
error.h
KDL::IOTracePop
void IOTracePop()
pops a description of the IO-stack
Definition:
error_stack.cxx:51
KDL::EatWord
void EatWord(std::istream &is, const char *delim, char *storage, int maxsize)
Definition:
utility_io.cxx:197
error_stack.h
KDL::Eat
void Eat(std::istream &is, int delim)
Definition:
utility_io.cxx:123
std::istream
velocityprofile_traphalf.hpp
Generated on Thu Nov 14 2024 04:37:48 for orocos_kdl by
1.8.17