KDL  1.4.0
chainiksolvervel_pinv.hpp
Go to the documentation of this file.
1 // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
2 
3 // Version: 1.0
4 // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
5 // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
6 // URL: http://www.orocos.org/kdl
7 
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef KDL_CHAIN_IKSOLVERVEL_PINV_HPP
23 #define KDL_CHAIN_IKSOLVERVEL_PINV_HPP
24 
25 #include "chainiksolver.hpp"
26 #include "chainjnttojacsolver.hpp"
27 #include "utilities/svd_HH.hpp"
28 
29 namespace KDL
30 {
41  {
42  public:
44  static const int E_CONVERGE_PINV_SINGULAR = +100;
45 
57  explicit ChainIkSolverVel_pinv(const Chain& chain,double eps=0.00001,int maxiter=150);
59 
75  virtual int CartToJnt(const JntArray& q_in, const Twist& v_in, JntArray& qdot_out);
80  virtual int CartToJnt(const JntArray& q_init, const FrameVel& v_in, JntArrayVel& q_out){return -1;};
81 
87  unsigned int getNrZeroSigmas()const {return nrZeroSigmas;};
88 
93  int getSVDResult()const {return svdResult;};
94 
96  virtual const char* strError(const int error) const;
97 
99  virtual void updateInternalDataStructures();
100  private:
101  const Chain& chain;
103  unsigned int nj;
105  SVD_HH svd;
106  std::vector<JntArray> U;
108  std::vector<JntArray> V;
110  double eps;
111  int maxiter;
112  unsigned int nrZeroSigmas;
114 
115  };
116 }
117 #endif
118 
unsigned int nj
Definition: chainiksolvervel_pinv.hpp:103
std::vector< JntArray > V
Definition: chainiksolvervel_pinv.hpp:108
Definition: jacobian.hpp:36
double eps
Definition: chainiksolvervel_pinv.hpp:110
This class encapsulates a serial kinematic interconnection structure.
Definition: chain.hpp:35
JntArray tmp
Definition: chainiksolvervel_pinv.hpp:109
const Chain & chain
Definition: chainiksolvervel_pinv.hpp:101
unsigned int getNrZeroSigmas() const
Retrieve the number of singular values of the jacobian that are < eps; if the number of near zero sin...
Definition: chainiksolvervel_pinv.hpp:87
This class represents an fixed size array containing joint values of a KDL::Chain.
Definition: jntarray.hpp:69
virtual int CartToJnt(const JntArray &q_in, const Twist &v_in, JntArray &qdot_out)
Find an output joint velocity qdot_out, given a starting joint pose q_init and a desired cartesian ve...
Definition: chainiksolvervel_pinv.cpp:62
ChainJntToJacSolver jnt2jac
Definition: chainiksolvervel_pinv.hpp:102
ChainIkSolverVel_pinv(const Chain &chain, double eps=0.00001, int maxiter=150)
Constructor of the solver.
Definition: chainiksolvervel_pinv.cpp:26
JntArray S
Definition: chainiksolvervel_pinv.hpp:107
Class to calculate the jacobian of a general KDL::Chain, it is used by other solvers.
Definition: chainjnttojacsolver.hpp:41
virtual void updateInternalDataStructures()
Update the internal data structures.
Definition: chainiksolvervel_pinv.cpp:43
represents both translational and rotational velocities.
Definition: frames.hpp:720
SVD_HH svd
Definition: chainiksolvervel_pinv.hpp:105
static const int E_CONVERGE_PINV_SINGULAR
solution converged but (pseudo)inverse is singular
Definition: chainiksolvervel_pinv.hpp:44
Definition: articulatedbodyinertia.cpp:28
~ChainIkSolverVel_pinv()
Definition: chainiksolvervel_pinv.cpp:57
unsigned int nrZeroSigmas
Definition: chainiksolvervel_pinv.hpp:112
Implementation of a inverse velocity kinematics algorithm based on the generalize pseudo inverse to c...
Definition: chainiksolvervel_pinv.hpp:40
Definition: jntarrayvel.hpp:45
Jacobian jac
Definition: chainiksolvervel_pinv.hpp:104
int getSVDResult() const
Retrieve the latest return code from the SVD algorithm.
Definition: chainiksolvervel_pinv.hpp:93
std::vector< JntArray > U
Definition: chainiksolvervel_pinv.hpp:106
virtual int CartToJnt(const JntArray &q_init, const FrameVel &v_in, JntArrayVel &q_out)
not (yet) implemented.
Definition: chainiksolvervel_pinv.hpp:80
virtual const char * strError(const int error) const
Return a description of the latest error.
Definition: chainiksolvervel_pinv.cpp:132
Definition: framevel.hpp:197
int error
Latest error, initialized to E_NOERROR in constructor.
Definition: solveri.hpp:149
int maxiter
Definition: chainiksolvervel_pinv.hpp:111
int svdResult
Definition: chainiksolvervel_pinv.hpp:113
This abstract class encapsulates the inverse velocity solver for a KDL::Chain.
Definition: chainiksolver.hpp:66