Orocos KDL
chainiksolvervel_wdls.hpp
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
29namespace KDL
30{
64 {
65 public:
67 static const int E_CONVERGE_PINV_SINGULAR = +100;
68
80
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
217
218 private:
219 const Chain& chain;
220 ChainJntToJacSolver jnt2jac;
221 unsigned int nj;
222 Jacobian jac;
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;
237 double lambda_scaled;
238 unsigned int nrZeroSigmas ;
239 int svdResult;
240 double sigmaMin;
241 };
242}
243#endif
244
virtual const char * strError(const int error) const
int getSVDResult() const
Definition chainiksolvervel_wdls.hpp:210
double getEps() const
Definition chainiksolvervel_wdls.hpp:193
virtual void updateInternalDataStructures()
double getSigmaMin() const
Definition chainiksolvervel_wdls.hpp:183
void setMaxIter(const int maxiter_in)
static const int E_CONVERGE_PINV_SINGULAR
solution converged but (pseudo)inverse is singular
Definition chainiksolvervel_wdls.hpp:67
int getSigma(Eigen::VectorXd &Sout)
double getLambda() const
Definition chainiksolvervel_wdls.hpp:198
virtual int CartToJnt(const JntArray &, const FrameVel &, JntArrayVel &)
Definition chainiksolvervel_wdls.hpp:105
void setLambda(const double lambda)
unsigned int getNrZeroSigmas() const
Definition chainiksolvervel_wdls.hpp:178
ChainIkSolverVel_wdls(const Chain &chain, double eps=0.00001, int maxiter=150)
void setEps(const double eps_in)
int setWeightTS(const Eigen::MatrixXd &Mx)
virtual int CartToJnt(const JntArray &q_in, const Twist &v_in, JntArray &qdot_out)
int setWeightJS(const Eigen::MatrixXd &Mq)
double getLambdaScaled() const
Definition chainiksolvervel_wdls.hpp:204
This abstract class encapsulates the inverse velocity solver for a KDL::Chain.
Definition chainiksolver.hpp:66
Class to calculate the jacobian of a general KDL::Chain, it is used by other solvers.
Definition chainjnttojacsolver.hpp:39
This class encapsulates a serial kinematic interconnection structure. It is built out of segments.
Definition chain.hpp:35
Definition framevel.hpp:216
Definition jacobian.hpp:37
Definition jntarrayvel.hpp:46
Definition jntarray.hpp:70
int error
Latest error, initialized to E_NOERROR in constructor.
Definition solveri.hpp:149
represents both translational and rotational velocities.
Definition frames.hpp:723
Definition articulatedbodyinertia.hpp:32