orocos_kdl
error.h
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Erwin Aertbelien Mon Jan 10 16:38:38 CET 2005 error.h
3 
4  error.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  * \file
31  * Defines the exception classes that can be thrown
32  * \author
33  * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
34  *
35  * \version
36  * ORO_Geometry V0.2
37  *
38  * \par History
39  * - $log$
40  *
41  * \par Release
42  * $Id: error.h,v 1.1.1.1.2.2 2003/04/04 15:39:43 pissaris Exp $
43  * $Name: $
44  ****************************************************************************/
45 #ifndef ERROR_H_84822 // to make it unique, a random number
46 #define ERROR_H_84822
47 
48 #include "utility.h"
49 #include <string.h>
50 #include <string>
51 namespace KDL {
52 
56 class Error {
57 public:
62  virtual ~Error() {}
63  virtual const char* Description() const {return "Unspecified Error\n";}
64 
65  virtual int GetType() const {return 0;}
66 };
67 
68 
69 class Error_IO : public Error {
71  int typenr;
72 public:
73  Error_IO(const std::string& _msg="Unspecified I/O Error",int typenr=0):msg(_msg) {}
74  virtual const char* Description() const {return msg.c_str();}
75  virtual int GetType() const {return typenr;}
76 };
77 class Error_BasicIO : public Error_IO {};
78 class Error_BasicIO_File : public Error_BasicIO {
79 public:
80  virtual const char* Description() const {return "Error while reading stream";}
81  virtual int GetType() const {return 1;}
82 };
83 class Error_BasicIO_Exp_Delim : public Error_BasicIO {
84 public:
85  virtual const char* Description() const {return "Expected Delimiter not encountered";}
86  virtual int GetType() const {return 2;}
87 };
88 class Error_BasicIO_Not_A_Space : public Error_BasicIO {
89 public:
90  virtual const char* Description() const {return "Expected space,tab or newline not encountered";}
91  virtual int GetType() const {return 3;}
92 };
93 class Error_BasicIO_Unexpected : public Error_BasicIO {
94 public:
95  virtual const char* Description() const {return "Unexpected character";}
96  virtual int GetType() const {return 4;}
97 };
98 
99 class Error_BasicIO_ToBig : public Error_BasicIO {
100 public:
101  virtual const char* Description() const {return "Word that is read out of stream is bigger than maxsize";}
102  virtual int GetType() const {return 5;}
103 };
104 
105 class Error_BasicIO_Not_Opened : public Error_BasicIO {
106 public:
107  virtual const char* Description() const {return "File cannot be opened";}
108  virtual int GetType() const {return 6;}
109 };
110 class Error_FrameIO : public Error_IO {};
112 public:
113  virtual const char* Description() const {return "Unexpected identifier, expecting a vector (explicit or ZERO)";}
114  virtual int GetType() const {return 101;}
115 };
117 public:
118  virtual const char* Description() const {return "Unexpected identifier, expecting a Frame (explicit or DH)";}
119  virtual int GetType() const {return 102;}
120 };
122 public:
123  virtual const char* Description() const {return "Unexpected identifier, expecting a Rotation (explicit or EULERZYX, EULERZYZ, RPY,ROT,IDENTITY)";}
124  virtual int GetType() const {return 103;}
125 };
126 class Error_ChainIO : public Error {};
128 public:
129  virtual const char* Description() const {return "Unexpected identifier, expecting TRANS or ROT";}
130  virtual int GetType() const {return 201;}
131 };
133 class Error_RedundancyIO:public Error_IO {};
135 public:
136  virtual const char* Description() const {return "Illegal Resolutiontype is used in I/O with ResolutionTask";}
137  virtual int GetType() const {return 301;}
138 };
139 class Error_Redundancy:public Error {};
141 public:
142  virtual const char* Description() const {return "Joint limits cannot be avoided";}
143  virtual int GetType() const {return 1002;}
144 };
146 public:
147  virtual const char* Description() const {return "Manipulability is very low";}
148  virtual int GetType() const {return 1003;}
149 };
150 class Error_MotionIO : public Error {};
152 public:
153  virtual const char* Description() const { return "Wrong keyword while reading motion profile";}
154  virtual int GetType() const {return 2001;}
155 };
157 public:
158  virtual const char* Description() const { return "Trajectory type keyword not known";}
159  virtual int GetType() const {return 2002;}
160 };
161 
162 class Error_MotionPlanning : public Error {};
163 
165 public:
166  virtual const char* Description() const { return "Circle : radius is to small";}
167  virtual int GetType() const {return 3001;}
168 };
169 
171 public:
172  virtual const char* Description() const { return "Circle : Plane for motion is not properly defined";}
173  virtual int GetType() const {return 3002;}
174 };
175 
177 public:
178  virtual const char* Description() const { return "Acceleration of a rectangular velocityprofile cannot be used";}
179  virtual int GetType() const {return 3003;}
180 };
181 
183  int reason;
184 public:
185  Error_MotionPlanning_Not_Feasible(int _reason):reason(_reason) {}
186  virtual const char* Description() const {
187  return "Motion Profile with requested parameters is not feasible";
188  }
189  virtual int GetType() const {return 3100+reason;}
190 };
191 
193 public:
194  virtual const char* Description() const { return "Method is not applicable for this derived object";}
195  virtual int GetType() const {return 3004;}
196 };
198 class Error_Integrator : public Error {};
199 
202 public:
203  virtual const char* Description() const { return "Stepsize Underflow";}
204  virtual int GetType() const {return 4001;}
205 };
206 
209 class Error_To_Many_Steps : public Error_Integrator {
210 public:
211  virtual const char* Description() const { return "To many steps"; }
212  virtual int GetType() const {return 4002;}
213 };
214 
217 public:
218  virtual const char* Description() const { return "Stepsize to small"; }
219  virtual int GetType() const {return 4003;}
220 };
221 
222 class Error_Criterium : public Error {};
223 
225 public:
226  virtual const char* Description() const { return "Unexpected identifier while reading a criterium"; }
227  virtual int GetType() const {return 5001;}
228 };
229 
230 class Error_Limits : public Error {};
231 
233 public:
234  virtual const char* Description() const { return "Unexpected identifier while reading a jointlimits"; }
235  virtual int GetType() const {return 6001;}
236 };
237 
238 
239 class Error_Not_Implemented: public Error {
240 public:
241  virtual const char* Description() const { return "The requested object/method/function is not implemented"; }
242  virtual int GetType() const {return 7000;}
243 };
244 
245 
246 
247 }
248 
249 #endif
KDL::Error_Chain_Unexpected_id::GetType
virtual int GetType() const
Definition: error.h:170
KDL::Error_MotionPlanning
Definition: error.h:202
KDL::Error_Not_Implemented::Description
virtual const char * Description() const
Definition: error.h:281
KDL::Error_Chain_Unexpected_id::Description
virtual const char * Description() const
Definition: error.h:169
KDL::Error_Frame_Frame_Unexpected_id::Description
virtual const char * Description() const
Definition: error.h:158
KDL::Error_Redundancy_Unavoidable::GetType
virtual int GetType() const
Definition: error.h:183
std::string
KDL::Error_Redundancy
Definition: error.h:179
KDL::Error_BasicIO_Not_Opened::Description
virtual const char * Description() const
Definition: error.h:147
KDL::Error_Frame_Rotation_Unexpected_id::GetType
virtual int GetType() const
Definition: error.h:164
KDL::Error::Description
virtual const char * Description() const
Definition: error.h:143
KDL::Error_MotionPlanning_Incompatible::GetType
virtual int GetType() const
Definition: error.h:219
KDL::Error_Redundancy_Illegal_Resolutiontype::Description
virtual const char * Description() const
Definition: error.h:176
KDL::Error_Frame_Frame_Unexpected_id
Definition: error.h:156
KDL::Error_Limits_Unexpected_id
Definition: error.h:272
KDL::Error_IO::GetType
virtual int GetType() const
Definition: error.h:115
KDL::Error_Criterium_Unexpected_id::GetType
virtual int GetType() const
Definition: error.h:267
KDL::Error_MotionPlanning_Circle_ToSmall::GetType
virtual int GetType() const
Definition: error.h:207
KDL::Error_Redundancy_Unavoidable::Description
virtual const char * Description() const
Definition: error.h:182
KDL::Error_IO::Error_IO
Error_IO(const std::string &_msg="Unspecified I/O Error", int typenr=0)
Definition: error.h:113
KDL::Error_BasicIO_Not_A_Space::Description
virtual const char * Description() const
Definition: error.h:130
utility.h
KDL::Error_Redundancy_Low_Manip
Definition: error.h:185
KDL::Error_MotionPlanning_Circle_No_Plane::GetType
virtual int GetType() const
Definition: error.h:213
KDL
Definition: kukaLWR_DHnew.cpp:25
KDL::Error_MotionIO_Unexpected_MotProf
Definition: error.h:191
KDL::Error_BasicIO_ToBig::GetType
virtual int GetType() const
Definition: error.h:142
KDL::Error_MotionPlanning_Not_Feasible::Description
virtual const char * Description() const
Definition: error.h:226
KDL::Error_Redundancy_Unavoidable
Definition: error.h:180
KDL::Error_MotionPlanning_Circle_No_Plane
Definition: error.h:210
KDL::Error_Not_Implemented
Definition: error.h:279
KDL::Error_Frame_Vector_Unexpected_id::GetType
virtual int GetType() const
Definition: error.h:154
KDL::Error_Redundancy_Illegal_Resolutiontype::GetType
virtual int GetType() const
Definition: error.h:177
KDL::Error_Frame_Frame_Unexpected_id::GetType
virtual int GetType() const
Definition: error.h:159
KDL::Error_BasicIO_Exp_Delim::GetType
virtual int GetType() const
Definition: error.h:126
KDL::Error_BasicIO_File::Description
virtual const char * Description() const
Definition: error.h:120
KDL::Error_BasicIO_ToBig::Description
virtual const char * Description() const
Definition: error.h:141
KDL::Error_Stepsize_Underflow::GetType
virtual int GetType() const
Definition: error.h:244
KDL::Error_RedundancyIO
Error_Redundancy indicates an error that occurred during solving for redundancy.
Definition: error.h:173
KDL::Error_IO::typenr
int typenr
Definition: error.h:111
KDL::Error_To_Many_Steps::Description
virtual const char * Description() const
Definition: error.h:251
KDL::Error_Chain_Unexpected_id
Definition: error.h:167
KDL::Error::GetType
virtual int GetType() const
Definition: error.h:145
KDL::Error::~Error
virtual ~Error()
Definition: error.h:142
KDL::Error_BasicIO_Not_A_Space::GetType
virtual int GetType() const
Definition: error.h:131
std::string::c_str
T c_str(T... args)
KDL::Error_BasicIO_Unexpected::GetType
virtual int GetType() const
Definition: error.h:136
KDL::Error_BasicIO_File::GetType
virtual int GetType() const
Definition: error.h:121
KDL::Error
Definition: error.h:96
KDL::Error_Not_Implemented::GetType
virtual int GetType() const
Definition: error.h:282
KDL::Error_MotionPlanning_Not_Feasible
Definition: error.h:222
KDL::Error_ChainIO
Definition: error.h:166
KDL::Error_MotionPlanning_Circle_ToSmall
Definition: error.h:204
KDL::Error_IO
Definition: error.h:109
KDL::Error_Frame_Rotation_Unexpected_id::Description
virtual const char * Description() const
Definition: error.h:163
KDL::Error_MotionPlanning_Incompatible::Description
virtual const char * Description() const
Definition: error.h:218
KDL::Error_Limits
Definition: error.h:270
KDL::Error_Frame_Vector_Unexpected_id::Description
virtual const char * Description() const
Definition: error.h:153
KDL::Error_Stepsize_Underflow::Description
virtual const char * Description() const
Definition: error.h:243
KDL::Error_BasicIO_Unexpected::Description
virtual const char * Description() const
Definition: error.h:135
KDL::Error_MotionPlanning_Incompatible
Definition: error.h:216
KDL::Error_MotionPlanning_Not_Feasible::Error_MotionPlanning_Not_Feasible
Error_MotionPlanning_Not_Feasible(int _reason)
Definition: error.h:225
KDL::Error_MotionPlanning_Not_Applicable::Description
virtual const char * Description() const
Definition: error.h:234
KDL::Error_IO::msg
std::string msg
Definition: error.h:110
KDL::Error_Criterium_Unexpected_id
Definition: error.h:264
KDL::Error_MotionIO_Unexpected_Traj
Definition: error.h:196
KDL::Error_To_Many_Steps
Definition: error.h:249
KDL::Error_Stepsize_Underflow
Error_Stepsize_Underflow is thrown if the stepsize becomes to small.
Definition: error.h:241
KDL::Error_MotionPlanning_Not_Applicable
Definition: error.h:232
KDL::Error_MotionPlanning_Circle_ToSmall::Description
virtual const char * Description() const
Definition: error.h:206
KDL::Error_Integrator
Abstract subclass of all errors that can be thrown by Adaptive_Integrator.
Definition: error.h:238
KDL::Error_Criterium
Definition: error.h:262
KDL::Error_IO::Description
virtual const char * Description() const
Definition: error.h:114
KDL::Error_MotionPlanning_Not_Feasible::reason
int reason
Definition: error.h:223
KDL::Error_MotionPlanning_Not_Feasible::GetType
virtual int GetType() const
Definition: error.h:229
KDL::Error_FrameIO
Definition: error.h:150
KDL::Error_BasicIO_Not_Opened::GetType
virtual int GetType() const
Definition: error.h:148
KDL::Error_Stepsize_To_Small
Error_Stepsize_To_Small is thrown if the stepsize becomes to small
Definition: error.h:256
KDL::Error_MotionPlanning_Not_Applicable::GetType
virtual int GetType() const
Definition: error.h:235
KDL::Error_MotionIO
Definition: error.h:190
KDL::Error_Frame_Rotation_Unexpected_id
Definition: error.h:161
KDL::Error_Redundancy_Illegal_Resolutiontype
Definition: error.h:174
KDL::Error_To_Many_Steps::GetType
virtual int GetType() const
Definition: error.h:252
KDL::Error_Frame_Vector_Unexpected_id
Definition: error.h:151
KDL::Error_MotionPlanning_Circle_No_Plane::Description
virtual const char * Description() const
Definition: error.h:212
KDL::Error_BasicIO_Exp_Delim::Description
virtual const char * Description() const
Definition: error.h:125
string