KDL  1.3.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:
43  static const int E_SVD_FAILED = -100;
44  static const int E_CONVERGE_PINV_SINGULAR = +100;
46 
58  explicit ChainIkSolverVel_pinv(const Chain& chain,double eps=0.00001,int maxiter=150);
60 
76  virtual int CartToJnt(const JntArray& q_in, const Twist& v_in, JntArray& qdot_out);
81  virtual int CartToJnt(const JntArray& q_init, const FrameVel& v_in, JntArrayVel& q_out){return -1;};
82 
88  unsigned int getNrZeroSigmas()const {return nrZeroSigmas;};
89 
94  int getSVDResult()const {return svdResult;};
95 
97  virtual const char* strError(const int error) const;
98 
99  private:
100  const Chain chain;
103  SVD_HH svd;
104  std::vector<JntArray> U;
106  std::vector<JntArray> V;
108  double eps;
109  int maxiter;
110  unsigned int nrZeroSigmas;
112 
113  };
114 }
115 #endif
116 
std::vector< JntArray > V
Definition: chainiksolvervel_pinv.hpp:106
Definition: jacobian.hpp:35
double eps
Definition: chainiksolvervel_pinv.hpp:108
This class encapsulates a serial kinematic interconnection structure.
Definition: chain.hpp:35
JntArray tmp
Definition: chainiksolvervel_pinv.hpp:107
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:47
ChainJntToJacSolver jnt2jac
Definition: chainiksolvervel_pinv.hpp:101
const Chain chain
Definition: chainiksolvervel_pinv.hpp:100
ChainIkSolverVel_pinv(const Chain &chain, double eps=0.00001, int maxiter=150)
Constructor of the solver.
Definition: chainiksolvervel_pinv.cpp:26
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:88
JntArray S
Definition: chainiksolvervel_pinv.hpp:105
Class to calculate the jacobian of a general KDL::Chain, it is used by other solvers.
Definition: chainjnttojacsolver.hpp:41
represents both translational and rotational velocities.
Definition: frames.hpp:720
SVD_HH svd
Definition: chainiksolvervel_pinv.hpp:103
static const int E_CONVERGE_PINV_SINGULAR
Child SVD failed.
Definition: chainiksolvervel_pinv.hpp:45
Definition: articulatedbodyinertia.cpp:28
~ChainIkSolverVel_pinv()
Definition: chainiksolvervel_pinv.cpp:42
unsigned int nrZeroSigmas
Definition: chainiksolvervel_pinv.hpp:110
Implementation of a inverse velocity kinematics algorithm based on the generalize pseudo inverse to c...
Definition: chainiksolvervel_pinv.hpp:40
int getSVDResult() const
Retrieve the latest return code from the SVD algorithm.
Definition: chainiksolvervel_pinv.hpp:94
Definition: jntarrayvel.hpp:45
Jacobian jac
Definition: chainiksolvervel_pinv.hpp:102
std::vector< JntArray > U
Definition: chainiksolvervel_pinv.hpp:104
static const int E_SVD_FAILED
Definition: chainiksolvervel_pinv.hpp:43
virtual int CartToJnt(const JntArray &q_init, const FrameVel &v_in, JntArrayVel &q_out)
not (yet) implemented.
Definition: chainiksolvervel_pinv.hpp:81
virtual const char * strError(const int error) const
Return a description of the latest error.
Definition: chainiksolvervel_pinv.cpp:110
Definition: framevel.hpp:197
int error
Latest error, initialized to E_NOERROR in constructor.
Definition: solveri.hpp:122
int maxiter
Definition: chainiksolvervel_pinv.hpp:109
int svdResult
Definition: chainiksolvervel_pinv.hpp:111
This abstract class encapsulates the inverse velocity solver for a KDL::Chain.
Definition: chainiksolver.hpp:65