orocos_kdl
chainiksolvervel_wdls.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_WDLS_HPP
23 #define KDL_CHAIN_IKSOLVERVEL_WDLS_HPP
24 
25 #include "chainiksolver.hpp"
26 #include "chainjnttojacsolver.hpp"
27 #include <Eigen/Core>
28 
29 namespace KDL
30 {
64  {
65  public:
67  static const int E_CONVERGE_PINV_SINGULAR = +100;
68 
81  explicit ChainIkSolverVel_wdls(const Chain& chain,double eps=0.00001,int maxiter=150);
82  //=ublas::identity_matrix<double>
84 
100  virtual int CartToJnt(const JntArray& q_in, const Twist& v_in, JntArray& qdot_out);
105  virtual int CartToJnt(const JntArray& /*q_init*/, const FrameVel& /*v_in*/, JntArrayVel& /*q_out*/){return -1;};
106 
131  int setWeightJS(const Eigen::MatrixXd& Mq);
132 
158  int setWeightTS(const Eigen::MatrixXd& Mx);
159 
163  void setLambda(const double lambda);
167  void setEps(const double eps_in);
171  void setMaxIter(const int maxiter_in);
172 
178  unsigned int getNrZeroSigmas()const {return nrZeroSigmas;};
179 
183  double getSigmaMin()const {return sigmaMin;};
184 
188  int getSigma(Eigen::VectorXd& Sout);
189 
193  double getEps()const {return eps;};
194 
198  double getLambda()const {return lambda;};
199 
204  double getLambdaScaled()const {return lambda_scaled;};
205 
210  int getSVDResult()const {return svdResult;};
211 
213  virtual const char* strError(const int error) const;
214 
216  virtual void updateInternalDataStructures();
217 
218  private:
219  const Chain& chain;
221  unsigned int nj;
223  Eigen::MatrixXd U;
224  Eigen::VectorXd S;
225  Eigen::MatrixXd V;
226  double eps;
227  int maxiter;
228  Eigen::VectorXd tmp;
229  Eigen::MatrixXd tmp_jac;
230  Eigen::MatrixXd tmp_jac_weight1;
231  Eigen::MatrixXd tmp_jac_weight2;
232  Eigen::MatrixXd tmp_ts;
233  Eigen::MatrixXd tmp_js;
234  Eigen::MatrixXd weight_ts;
235  Eigen::MatrixXd weight_js;
236  double lambda;
238  unsigned int nrZeroSigmas ;
240  double sigmaMin;
241  };
242 }
243 #endif
244 
KDL::ChainIkSolverVel_wdls::svdResult
int svdResult
Definition: chainiksolvervel_wdls.hpp:239
KDL::ChainIkSolverVel_wdls::tmp_jac
Eigen::MatrixXd tmp_jac
Definition: chainiksolvervel_wdls.hpp:229
KDL::ChainIkSolverVel_wdls::eps
double eps
Definition: chainiksolvervel_wdls.hpp:226
KDL::ChainIkSolverVel_wdls::jac
Jacobian jac
Definition: chainiksolvervel_wdls.hpp:222
KDL::ChainIkSolverVel_wdls::updateInternalDataStructures
virtual void updateInternalDataStructures()
Definition: chainiksolvervel_wdls.cpp:54
KDL::ChainIkSolverVel_wdls::tmp_jac_weight1
Eigen::MatrixXd tmp_jac_weight1
Definition: chainiksolvervel_wdls.hpp:230
KDL::JntArray
Definition: jntarray.hpp:69
KDL::ChainIkSolverVel_wdls::ChainIkSolverVel_wdls
ChainIkSolverVel_wdls(const Chain &chain, double eps=0.00001, int maxiter=150)
Definition: chainiksolvervel_wdls.cpp:28
KDL::ChainIkSolverVel_wdls::CartToJnt
virtual int CartToJnt(const JntArray &, const FrameVel &, JntArrayVel &)
Definition: chainiksolvervel_wdls.hpp:105
KDL::ChainIkSolverVel_wdls::CartToJnt
virtual int CartToJnt(const JntArray &q_in, const Twist &v_in, JntArray &qdot_out)
Definition: chainiksolvervel_wdls.cpp:116
KDL::ChainIkSolverVel_wdls::getSigma
int getSigma(Eigen::VectorXd &Sout)
Definition: chainiksolvervel_wdls.cpp:108
KDL::ChainIkSolverVel_wdls::nrZeroSigmas
unsigned int nrZeroSigmas
Definition: chainiksolvervel_wdls.hpp:238
KDL::ChainIkSolverVel_wdls::U
Eigen::MatrixXd U
Definition: chainiksolvervel_wdls.hpp:223
KDL::ChainIkSolverVel_wdls::setWeightJS
int setWeightJS(const Eigen::MatrixXd &Mq)
Definition: chainiksolvervel_wdls.cpp:76
KDL
Definition: kukaLWR_DHnew.cpp:25
KDL::ChainIkSolverVel_wdls::setWeightTS
int setWeightTS(const Eigen::MatrixXd &Mx)
Definition: chainiksolvervel_wdls.cpp:86
KDL::Twist
represents both translational and rotational velocities.
Definition: frames.hpp:723
KDL::ChainIkSolverVel_wdls::setMaxIter
void setMaxIter(const int maxiter_in)
Definition: chainiksolvervel_wdls.cpp:103
KDL::ChainIkSolverVel_wdls::sigmaMin
double sigmaMin
Definition: chainiksolvervel_wdls.hpp:240
chainiksolver.hpp
KDL::ChainIkSolverVel_wdls::getLambda
double getLambda() const
Definition: chainiksolvervel_wdls.hpp:198
KDL::ChainIkSolverVel_wdls::getSVDResult
int getSVDResult() const
Definition: chainiksolvervel_wdls.hpp:210
KDL::ChainIkSolverVel_wdls::setLambda
void setLambda(const double lambda)
Definition: chainiksolvervel_wdls.cpp:93
KDL::ChainIkSolverVel_wdls::nj
unsigned int nj
Definition: chainiksolvervel_wdls.hpp:221
KDL::ChainIkSolverVel_wdls::getNrZeroSigmas
unsigned int getNrZeroSigmas() const
Definition: chainiksolvervel_wdls.hpp:178
KDL::ChainIkSolverVel_wdls::setEps
void setEps(const double eps_in)
Definition: chainiksolvervel_wdls.cpp:98
KDL::ChainIkSolverVel_wdls::getEps
double getEps() const
Definition: chainiksolvervel_wdls.hpp:193
KDL::ChainIkSolverVel_wdls::V
Eigen::MatrixXd V
Definition: chainiksolvervel_wdls.hpp:225
KDL::ChainIkSolverVel_wdls
Definition: chainiksolvervel_wdls.hpp:63
KDL::ChainIkSolverVel_wdls::maxiter
int maxiter
Definition: chainiksolvervel_wdls.hpp:227
KDL::ChainIkSolverVel_wdls::getSigmaMin
double getSigmaMin() const
Definition: chainiksolvervel_wdls.hpp:183
KDL::JntArrayVel
Definition: jntarrayvel.hpp:45
KDL::ChainIkSolverVel_wdls::lambda_scaled
double lambda_scaled
Definition: chainiksolvervel_wdls.hpp:237
KDL::ChainIkSolverVel_wdls::strError
virtual const char * strError(const int error) const
Definition: chainiksolvervel_wdls.cpp:218
KDL::ChainIkSolverVel_wdls::tmp_jac_weight2
Eigen::MatrixXd tmp_jac_weight2
Definition: chainiksolvervel_wdls.hpp:231
KDL::ChainIkSolverVel_wdls::lambda
double lambda
Definition: chainiksolvervel_wdls.hpp:236
KDL::ChainIkSolverVel_wdls::S
Eigen::VectorXd S
Definition: chainiksolvervel_wdls.hpp:224
KDL::ChainIkSolverVel_wdls::weight_js
Eigen::MatrixXd weight_js
Definition: chainiksolvervel_wdls.hpp:235
KDL::ChainIkSolverVel_wdls::tmp_js
Eigen::MatrixXd tmp_js
Definition: chainiksolvervel_wdls.hpp:233
KDL::ChainIkSolverVel_wdls::weight_ts
Eigen::MatrixXd weight_ts
Definition: chainiksolvervel_wdls.hpp:234
KDL::ChainIkSolverVel_wdls::~ChainIkSolverVel_wdls
~ChainIkSolverVel_wdls()
Definition: chainiksolvervel_wdls.cpp:72
KDL::ChainIkSolverVel_wdls::E_CONVERGE_PINV_SINGULAR
static const int E_CONVERGE_PINV_SINGULAR
solution converged but (pseudo)inverse is singular
Definition: chainiksolvervel_wdls.hpp:67
KDL::ChainIkSolverVel_wdls::chain
const Chain & chain
Definition: chainiksolvervel_wdls.hpp:219
KDL::FrameVel
Definition: framevel.hpp:209
KDL::ChainIkSolverVel
This abstract class encapsulates the inverse velocity solver for a KDL::Chain.
Definition: chainiksolver.hpp:66
chainjnttojacsolver.hpp
KDL::ChainIkSolverVel_wdls::getLambdaScaled
double getLambdaScaled() const
Definition: chainiksolvervel_wdls.hpp:204
KDL::ChainJntToJacSolver
Class to calculate the jacobian of a general KDL::Chain, it is used by other solvers.
Definition: chainjnttojacsolver.hpp:38
KDL::ChainIkSolverVel_wdls::tmp_ts
Eigen::MatrixXd tmp_ts
Definition: chainiksolvervel_wdls.hpp:232
KDL::Chain
This class encapsulates a serial kinematic interconnection structure. It is built out of segments.
Definition: chain.hpp:35
KDL::ChainIkSolverVel_wdls::tmp
Eigen::VectorXd tmp
Definition: chainiksolvervel_wdls.hpp:228
KDL::SolverI::error
int error
Latest error, initialized to E_NOERROR in constructor.
Definition: solveri.hpp:149
KDL::ChainIkSolverVel_wdls::jnt2jac
ChainJntToJacSolver jnt2jac
Definition: chainiksolvervel_wdls.hpp:220
KDL::Jacobian
Definition: jacobian.hpp:36