$search
00001 /*************************************************************************** 00002 tag: Erwin Aertbelien Mon Jan 10 16:38:38 CET 2005 error.h 00003 00004 error.h - description 00005 ------------------- 00006 begin : Mon January 10 2005 00007 copyright : (C) 2005 Erwin Aertbelien 00008 email : erwin.aertbelien@mech.kuleuven.ac.be 00009 00010 *************************************************************************** 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, * 00024 * Suite 330, Boston, MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 00029 /***************************************************************************** 00030 * \file 00031 * Defines the exception classes that can be thrown 00032 * \author 00033 * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven 00034 * 00035 * \version 00036 * ORO_Geometry V0.2 00037 * 00038 * \par History 00039 * - $log$ 00040 * 00041 * \par Release 00042 * $Id: error.h,v 1.1.1.1.2.2 2003/04/04 15:39:43 pissaris Exp $ 00043 * $Name: $ 00044 ****************************************************************************/ 00045 #ifndef ERROR_H_84822 // to make it unique, a random number 00046 #define ERROR_H_84822 00047 00048 #include "utility.h" 00049 #include <string.h> 00050 #include <string> 00051 namespace KDL { 00052 00056 class Error { 00057 public: 00062 virtual ~Error() {} 00063 virtual const char* Description() const {return "Unspecified Error\n";} 00064 00065 virtual int GetType() const {return 0;} 00066 }; 00067 00068 00069 class Error_IO : public Error { 00070 std::string msg; 00071 int typenr; 00072 public: 00073 Error_IO(const std::string& _msg="Unspecified I/O Error",int typenr=0):msg(_msg) {} 00074 virtual const char* Description() const {return msg.c_str();} 00075 virtual int GetType() const {return typenr;} 00076 }; 00077 class Error_BasicIO : public Error_IO {}; 00078 class Error_BasicIO_File : public Error_BasicIO { 00079 public: 00080 virtual const char* Description() const {return "Error while reading stream";} 00081 virtual int GetType() const {return 1;} 00082 }; 00083 class Error_BasicIO_Exp_Delim : public Error_BasicIO { 00084 public: 00085 virtual const char* Description() const {return "Expected Delimiter not encountered";} 00086 virtual int GetType() const {return 2;} 00087 }; 00088 class Error_BasicIO_Not_A_Space : public Error_BasicIO { 00089 public: 00090 virtual const char* Description() const {return "Expected space,tab or newline not encountered";} 00091 virtual int GetType() const {return 3;} 00092 }; 00093 class Error_BasicIO_Unexpected : public Error_BasicIO { 00094 public: 00095 virtual const char* Description() const {return "Unexpected character";} 00096 virtual int GetType() const {return 4;} 00097 }; 00098 00099 class Error_BasicIO_ToBig : public Error_BasicIO { 00100 public: 00101 virtual const char* Description() const {return "Word that is read out of stream is bigger than maxsize";} 00102 virtual int GetType() const {return 5;} 00103 }; 00104 00105 class Error_BasicIO_Not_Opened : public Error_BasicIO { 00106 public: 00107 virtual const char* Description() const {return "File cannot be opened";} 00108 virtual int GetType() const {return 6;} 00109 }; 00110 class Error_FrameIO : public Error_IO {}; 00111 class Error_Frame_Vector_Unexpected_id : public Error_FrameIO { 00112 public: 00113 virtual const char* Description() const {return "Unexpected identifier, expecting a vector (explicit or ZERO)";} 00114 virtual int GetType() const {return 101;} 00115 }; 00116 class Error_Frame_Frame_Unexpected_id : public Error_FrameIO { 00117 public: 00118 virtual const char* Description() const {return "Unexpected identifier, expecting a Frame (explicit or DH)";} 00119 virtual int GetType() const {return 102;} 00120 }; 00121 class Error_Frame_Rotation_Unexpected_id : public Error_FrameIO { 00122 public: 00123 virtual const char* Description() const {return "Unexpected identifier, expecting a Rotation (explicit or EULERZYX, EULERZYZ, RPY,ROT,IDENTITY)";} 00124 virtual int GetType() const {return 103;} 00125 }; 00126 class Error_ChainIO : public Error {}; 00127 class Error_Chain_Unexpected_id : public Error_ChainIO { 00128 public: 00129 virtual const char* Description() const {return "Unexpected identifier, expecting TRANS or ROT";} 00130 virtual int GetType() const {return 201;} 00131 }; 00133 class Error_RedundancyIO:public Error_IO {}; 00134 class Error_Redundancy_Illegal_Resolutiontype : public Error_RedundancyIO { 00135 public: 00136 virtual const char* Description() const {return "Illegal Resolutiontype is used in I/O with ResolutionTask";} 00137 virtual int GetType() const {return 301;} 00138 }; 00139 class Error_Redundancy:public Error {}; 00140 class Error_Redundancy_Unavoidable : public Error_Redundancy { 00141 public: 00142 virtual const char* Description() const {return "Joint limits cannot be avoided";} 00143 virtual int GetType() const {return 1002;} 00144 }; 00145 class Error_Redundancy_Low_Manip: public Error_Redundancy { 00146 public: 00147 virtual const char* Description() const {return "Manipulability is very low";} 00148 virtual int GetType() const {return 1003;} 00149 }; 00150 class Error_MotionIO : public Error {}; 00151 class Error_MotionIO_Unexpected_MotProf : public Error_MotionIO { 00152 public: 00153 virtual const char* Description() const { return "Wrong keyword while reading motion profile";} 00154 virtual int GetType() const {return 2001;} 00155 }; 00156 class Error_MotionIO_Unexpected_Traj : public Error_MotionIO { 00157 public: 00158 virtual const char* Description() const { return "Trajectory type keyword not known";} 00159 virtual int GetType() const {return 2002;} 00160 }; 00161 00162 class Error_MotionPlanning : public Error {}; 00163 00164 class Error_MotionPlanning_Circle_ToSmall : public Error_MotionPlanning { 00165 public: 00166 virtual const char* Description() const { return "Circle : radius is to small";} 00167 virtual int GetType() const {return 3001;} 00168 }; 00169 00170 class Error_MotionPlanning_Circle_No_Plane : public Error_MotionPlanning { 00171 public: 00172 virtual const char* Description() const { return "Circle : Plane for motion is not properly defined";} 00173 virtual int GetType() const {return 3002;} 00174 }; 00175 00176 class Error_MotionPlanning_Incompatible: public Error_MotionPlanning { 00177 public: 00178 virtual const char* Description() const { return "Acceleration of a rectangular velocityprofile cannot be used";} 00179 virtual int GetType() const {return 3003;} 00180 }; 00181 00182 class Error_MotionPlanning_Not_Feasible: public Error_MotionPlanning { 00183 int reason; 00184 public: 00185 Error_MotionPlanning_Not_Feasible(int _reason):reason(_reason) {} 00186 virtual const char* Description() const { 00187 return "Motion Profile with requested parameters is not feasible"; 00188 } 00189 virtual int GetType() const {return 3100+reason;} 00190 }; 00191 00192 class Error_MotionPlanning_Not_Applicable: public Error_MotionPlanning { 00193 public: 00194 virtual const char* Description() const { return "Method is not applicable for this derived object";} 00195 virtual int GetType() const {return 3004;} 00196 }; 00198 class Error_Integrator : public Error {}; 00199 00201 class Error_Stepsize_Underflow : public Error_Integrator { 00202 public: 00203 virtual const char* Description() const { return "Stepsize Underflow";} 00204 virtual int GetType() const {return 4001;} 00205 }; 00206 00209 class Error_To_Many_Steps : public Error_Integrator { 00210 public: 00211 virtual const char* Description() const { return "To many steps"; } 00212 virtual int GetType() const {return 4002;} 00213 }; 00214 00216 class Error_Stepsize_To_Small : public Error_Integrator { 00217 public: 00218 virtual const char* Description() const { return "Stepsize to small"; } 00219 virtual int GetType() const {return 4003;} 00220 }; 00221 00222 class Error_Criterium : public Error {}; 00223 00224 class Error_Criterium_Unexpected_id: public Error_Criterium { 00225 public: 00226 virtual const char* Description() const { return "Unexpected identifier while reading a criterium"; } 00227 virtual int GetType() const {return 5001;} 00228 }; 00229 00230 class Error_Limits : public Error {}; 00231 00232 class Error_Limits_Unexpected_id: public Error_Limits { 00233 public: 00234 virtual const char* Description() const { return "Unexpected identifier while reading a jointlimits"; } 00235 virtual int GetType() const {return 6001;} 00236 }; 00237 00238 00239 class Error_Not_Implemented: public Error { 00240 public: 00241 virtual const char* Description() const { return "The requested object/method/function is not implemented"; } 00242 virtual int GetType() const {return 7000;} 00243 }; 00244 00245 00246 00247 } 00248 00249 #endif