solveri.hpp
Go to the documentation of this file.
1 // Copyright (C) 2013 Stephen Roderick <kiwi dot net at mac dot com>
2 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 #ifndef __SOLVERI_HPP
18 #define __SOLVERI_HPP
19 
20 namespace KDL {
21 
84 class SolverI
85 {
86 public:
87  enum {
89  E_DEGRADED = +1,
91  E_NOERROR = 0,
108  };
109 
113  {}
114 
115  virtual ~SolverI()
116  {}
117 
119  virtual int getError() const { return error; }
120 
125  virtual const char* strError(const int error) const
126  {
127  if (E_NOERROR == error) return "No error";
128  else if (E_NO_CONVERGE == error) return "Failed to converge";
129  else if (E_UNDEFINED == error) return "Undefined value";
130  else if (E_DEGRADED == error) return "Converged but degraded solution";
131  else if (E_NOT_UP_TO_DATE == error) return "Internal data structures not up to date with Chain";
132  else if (E_SIZE_MISMATCH == error) return "The size of the input does not match the internal state";
133  else if (E_MAX_ITERATIONS_EXCEEDED == error) return "The maximum number of iterations is exceeded";
134  else if (E_OUT_OF_RANGE == error) return "The requested index is out of range";
135  else if (E_NOT_IMPLEMENTED == error) return "The requested function is not yet implemented";
136  else if (E_SVD_FAILED == error) return "SVD failed";
137  else return "UNKNOWN ERROR";
138  }
139 
145  virtual void updateInternalDataStructures() = 0;
146 
147 protected:
149  int error;
150 };
151 
152 } // namespaces
153 
154 #endif
virtual int getError() const
Return the latest error.
Definition: solveri.hpp:119
Chain size changed.
Definition: solveri.hpp:97
Maximum number of iterations exceeded.
Definition: solveri.hpp:101
virtual const char * strError(const int error) const
Definition: solveri.hpp:125
Input size does not match internal state.
Definition: solveri.hpp:99
virtual void updateInternalDataStructures()=0
Failed to converge.
Definition: solveri.hpp:93
Undefined value (e.g. computed a NAN, or tan(90 degrees) )
Definition: solveri.hpp:95
Converged but degraded solution (e.g. WDLS with psuedo-inverse singular)
Definition: solveri.hpp:89
Not yet implemented.
Definition: solveri.hpp:105
Internal svd calculation failed.
Definition: solveri.hpp:107
Requested index out of range.
Definition: solveri.hpp:103
SolverI()
Initialize latest error to E_NOERROR.
Definition: solveri.hpp:111
virtual ~SolverI()
Definition: solveri.hpp:115
int error
Latest error, initialized to E_NOERROR in constructor.
Definition: solveri.hpp:149


orocos_kdl
Author(s):
autogenerated on Sat Jun 15 2019 19:07:36