$search
00001 /*************************************************************************** 00002 tag: Erwin Aertbelien Mon May 10 19:10:36 CEST 2004 rotational_interpolation.cxx 00003 00004 rotational_interpolation.cxx - description 00005 ------------------- 00006 begin : Mon May 10 2004 00007 copyright : (C) 2004 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 * \author 00029 * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven 00030 * 00031 * \version 00032 * ORO_Geometry V0.2 00033 * 00034 * \par History 00035 * - $log$ 00036 * 00037 * \par Release 00038 * $Id: rotational_interpolation.cpp,v 1.1.1.1.2.3 2003/02/24 13:13:06 psoetens Exp $ 00039 * $Name: $ 00040 ****************************************************************************/ 00041 00042 #include "utilities/error.h" 00043 #include "utilities/error_stack.h" 00044 #include "rotational_interpolation.hpp" 00045 #include "rotational_interpolation_sa.hpp" 00046 #include <memory> 00047 #include <cstring> 00048 00049 namespace KDL { 00050 00051 using namespace std; 00052 00053 RotationalInterpolation* RotationalInterpolation::Read(istream& is) { 00054 // auto_ptr because exception can be thrown ! 00055 IOTrace("RotationalInterpolation::Read"); 00056 char storage[64]; 00057 EatWord(is,"[",storage,sizeof(storage)); 00058 Eat(is,'['); 00059 if (strcmp(storage,"SINGLEAXIS")==0) { 00060 IOTrace("SINGLEAXIS"); 00061 EatEnd(is,']'); 00062 IOTracePop(); 00063 IOTracePop(); 00064 return new RotationalInterpolation_SingleAxis(); 00065 } else if (strcmp(storage,"THREEAXIS")==0) { 00066 IOTrace("THREEAXIS"); 00067 throw Error_Not_Implemented(); 00068 EatEnd(is,']'); 00069 IOTracePop(); 00070 IOTracePop(); 00071 return NULL; 00072 } else if (strcmp(storage,"TWOAXIS")==0) { 00073 IOTrace("TWOAXIS"); 00074 throw Error_Not_Implemented(); 00075 EatEnd(is,']'); 00076 IOTracePop(); 00077 IOTracePop(); 00078 return NULL; 00079 } else { 00080 throw Error_MotionIO_Unexpected_Traj(); 00081 } 00082 return NULL; // just to avoid the warning; 00083 } 00084 00085 } 00086