Welcome to mirror list, hosted at ThFree Co, Russian Federation.

error.h « utilities « kdl « itasc « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 868daef3db3ff5ce1a6ffe37280d9ddd7a5fed45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/***************************************************************************
  tag: Erwin Aertbelien  Mon Jan 10 16:38:38 CET 2005  error.h 

                        error.h -  description
                           -------------------
    begin                : Mon January 10 2005
    copyright            : (C) 2005 Erwin Aertbelien
    email                : erwin.aertbelien@mech.kuleuven.ac.be
 
 ***************************************************************************
 *   This library is free software; you can redistribute it and/or         *
 *   modify it under the terms of the GNU Lesser General Public            *
 *   License as published by the Free Software Foundation; either          *
 *   version 2.1 of the License, or (at your option) any later version.    *
 *                                                                         *
 *   This library is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   Lesser General Public License for more details.                       *
 *                                                                         *
 *   You should have received a copy of the GNU Lesser General Public      *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place,                                    *
 *   Suite 330, Boston, MA  02111-1307  USA                                *
 *                                                                         *
 ***************************************************************************/
 
 
/*****************************************************************************
 * \file  
 *		 Defines the exception classes that can be thrown
 *  \author 
 *  	Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
 *
 *  \version 
 *		ORO_Geometry V0.2
 *
 *	\par History
 *		- $log$
 *
 *	\par Release
 *		$Id$
 *		$Name:  $ 
 ****************************************************************************/
#ifndef ERROR_H_84822 // to make it unique, a random number
#define ERROR_H_84822

#include "utility.h"
#include <string>

namespace KDL {

/** 
 *  Base class for errors generated by ORO_Geometry 
 */
class Error {
public:
    /** Returns a description string describing the error.
     *  the returned pointer only garanteed to exists as long as 
     * the Error object exists.
     */
	virtual ~Error() {}
    virtual const char* Description() const {return "Unspecified Error\n";}

    virtual int GetType() const {return 0;}
};


class Error_IO : public Error {
	std::string msg;
	int typenr;
public:
	Error_IO(const std::string& _msg="Unspecified I/O Error",int typenr=0):msg(_msg) {}
    virtual const char* Description() const {return msg.c_str();}
    virtual int GetType() const {return typenr;}
};
class Error_BasicIO : public Error_IO {};
class Error_BasicIO_File : public Error_BasicIO {
public:
    virtual const char* Description() const {return "Error while reading stream";}
    virtual int GetType() const {return 1;}
};
class Error_BasicIO_Exp_Delim : public Error_BasicIO {
public:
    virtual const char* Description() const {return "Expected Delimiter not encountered";}
    virtual int GetType() const {return 2;}
};
class Error_BasicIO_Not_A_Space : public Error_BasicIO {
public:
    virtual const char* Description() const {return "Expected space,tab or newline not encountered";}
    virtual int GetType() const {return 3;}
};
class Error_BasicIO_Unexpected : public Error_BasicIO {
public:
    virtual const char* Description() const {return "Unexpected character";}
    virtual int GetType() const {return 4;}
};

class Error_BasicIO_ToBig : public Error_BasicIO {
public:
    virtual const char* Description() const {return "Word that is read out of stream is bigger than maxsize";}
    virtual int GetType() const {return 5;}
};

class Error_BasicIO_Not_Opened : public Error_BasicIO {
public:
    virtual const char* Description() const {return "File cannot be opened";}
    virtual int GetType() const {return 6;}
};
class Error_FrameIO : public Error_IO {};
class Error_Frame_Vector_Unexpected_id : public Error_FrameIO {
public:
    virtual const char* Description() const {return "Unexpected identifier, expecting a vector (explicit or ZERO)";}
    virtual int GetType() const {return 101;}
};
class Error_Frame_Frame_Unexpected_id : public Error_FrameIO {
public:
    virtual const char* Description() const {return "Unexpected identifier, expecting a Frame (explicit or DH)";}
    virtual int GetType() const {return 102;}
};
class Error_Frame_Rotation_Unexpected_id : public Error_FrameIO {
public:
    virtual const char* Description() const {return "Unexpected identifier, expecting a Rotation (explicit or EULERZYX, EULERZYZ, RPY,ROT,IDENTITY)";}
    virtual int GetType() const {return 103;}
};
class Error_ChainIO : public Error {};
class Error_Chain_Unexpected_id : public Error_ChainIO {
public:
    virtual const char* Description() const {return "Unexpected identifier, expecting TRANS or ROT";}
    virtual int GetType() const {return 201;}
};
//! Error_Redundancy indicates an error that occured during solving for redundancy.
class Error_RedundancyIO:public Error_IO  {};
class Error_Redundancy_Illegal_Resolutiontype : public Error_RedundancyIO {
public:
    virtual const char* Description() const {return "Illegal Resolutiontype is used in I/O with ResolutionTask";}
    virtual int GetType() const {return 301;}
};
class Error_Redundancy:public Error  {};
class Error_Redundancy_Unavoidable : public Error_Redundancy {
public:
    virtual const char* Description() const {return "Joint limits cannot be avoided";}
    virtual int GetType() const {return 1002;}
};
class  Error_Redundancy_Low_Manip: public Error_Redundancy {
public:
    virtual const char* Description() const {return "Manipulability is very low";}
    virtual int GetType() const {return 1003;}
};
class Error_MotionIO : public Error {};
class Error_MotionIO_Unexpected_MotProf : public Error_MotionIO {
public:
    virtual const char* Description() const { return "Wrong keyword while reading motion profile";}
    virtual int GetType() const {return 2001;}
};
class Error_MotionIO_Unexpected_Traj : public Error_MotionIO {
public:
    virtual const char* Description() const { return "Trajectory type keyword not known";}
    virtual int GetType() const {return 2002;}
};

class Error_MotionPlanning : public Error {};

class Error_MotionPlanning_Circle_ToSmall : public Error_MotionPlanning {
public:
    virtual const char* Description() const { return "Circle : radius is to small";}
    virtual int GetType() const {return 3001;}
};

class Error_MotionPlanning_Circle_No_Plane : public Error_MotionPlanning {
public:
    virtual const char* Description() const { return "Circle : Plane for motion is not properly defined";}
    virtual int GetType() const {return 3002;}
};

class Error_MotionPlanning_Incompatible: public Error_MotionPlanning {
public:
    virtual const char* Description() const { return "Acceleration of a rectangular velocityprofile cannot be used";}
    virtual int GetType() const {return 3003;}
};

class Error_MotionPlanning_Not_Feasible: public Error_MotionPlanning {
public:
    virtual const char* Description() const { return "Motion Profile with requested parameters is not feasible";}
    virtual int GetType() const {return 3004;}
};

class Error_MotionPlanning_Not_Applicable: public Error_MotionPlanning {
public:
    virtual const char* Description() const { return "Method is not applicable for this derived object";}
    virtual int GetType() const {return 3004;}
};
//! Abstract subclass of all errors that can be thrown by Adaptive_Integrator
class Error_Integrator : public Error {};

//! Error_Stepsize_Underflow is thrown if the stepsize becomes to small
class Error_Stepsize_Underflow  : public Error_Integrator {
public: 
    virtual const char* Description() const { return "Stepsize Underflow";}
    virtual int GetType() const {return 4001;}
};

//! Error_To_Many_Steps is thrown if the number of steps needed to
//! integrate to the desired accuracy becomes to big.
class Error_To_Many_Steps : public Error_Integrator {
public:
    virtual const char* Description() const { return "To many steps"; }
    virtual int GetType() const {return 4002;}
};

//! Error_Stepsize_To_Small is thrown if the stepsize becomes to small  
class Error_Stepsize_To_Small : public Error_Integrator {
public:
    virtual const char* Description() const { return "Stepsize to small"; }
    virtual int GetType() const {return 4003;}
};

class Error_Criterium : public Error {};

class Error_Criterium_Unexpected_id: public Error_Criterium {
public:
    virtual const char* Description() const { return "Unexpected identifier while reading a criterium";   }
    virtual int GetType() const {return 5001;}
};

class Error_Limits : public Error {};

class Error_Limits_Unexpected_id: public Error_Limits {
public:
    virtual const char* Description() const { return "Unexpected identifier while reading a jointlimits"; }
    virtual int GetType() const {return 6001;}
};


class Error_Not_Implemented: public Error {
public:
    virtual const char* Description() const { return "The requested object/method/function is not implemented"; }
    virtual int GetType() const {return 7000;}
};



}

#endif