kinematics-dynamics
ChainIkSolverPos_ID.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __CHAIN_IK_SOLVER_POS_ID_HPP__
4 #define __CHAIN_IK_SOLVER_POS_ID_HPP__
5 
6 #include <kdl/chain.hpp>
7 #include <kdl/chainfksolver.hpp>
8 #include <kdl/chainiksolver.hpp>
9 #include <kdl/chainjnttojacsolver.hpp>
10 #include <kdl/jacobian.hpp>
11 #include <kdl/jntarray.hpp>
12 
13 namespace roboticslab
14 {
15 
24 class ChainIkSolverPos_ID : public KDL::ChainIkSolverPos
25 {
26 public:
36  ChainIkSolverPos_ID(const KDL::Chain & chain, const KDL::JntArray & q_min, const KDL::JntArray & q_max, KDL::ChainFkSolverPos & fksolver);
37 
48  int CartToJnt(const KDL::JntArray & q_init, const KDL::Frame & p_in, KDL::JntArray & q_out) override;
49 
57  void updateInternalDataStructures() override;
58 
67  const char * strError(const int error) const override;
68 
70  static const int E_FKSOLVERPOS_FAILED = -100;
71 
73  static const int E_JACSOLVER_FAILED = -101;
74 
75 private:
76  KDL::JntArray computeDiffInvKin(const KDL::Twist & delta_twist);
77 
78  const KDL::Chain & chain;
79  unsigned int nj;
80 
81  KDL::JntArray qMin;
82  KDL::JntArray qMax;
83 
84  KDL::ChainFkSolverPos & fkSolverPos;
85  KDL::ChainJntToJacSolver jacSolver;
86 
87  KDL::Jacobian jacobian;
88 };
89 
90 } // namespace roboticslab
91 
92 #endif // __CHAIN_IK_SOLVER_POS_ID_HPP__
IK solver using infinitesimal displacement twists.
Definition: ChainIkSolverPos_ID.hpp:25
void updateInternalDataStructures() override
Update the internal data structures.
Definition: ChainIkSolverPos_ID.cpp:107
static const int E_FKSOLVERPOS_FAILED
Return code, internal FK position solver failed.
Definition: ChainIkSolverPos_ID.hpp:70
static const int E_JACSOLVER_FAILED
Return code, internal Jacobian solver failed.
Definition: ChainIkSolverPos_ID.hpp:73
ChainIkSolverPos_ID(const KDL::Chain &chain, const KDL::JntArray &q_min, const KDL::JntArray &q_max, KDL::ChainFkSolverPos &fksolver)
Constructor.
Definition: ChainIkSolverPos_ID.cpp:16
int CartToJnt(const KDL::JntArray &q_init, const KDL::Frame &p_in, KDL::JntArray &q_out) override
Calculate inverse position kinematics.
Definition: ChainIkSolverPos_ID.cpp:29
const char * strError(const int error) const override
Return a description of the last error.
Definition: ChainIkSolverPos_ID.cpp:119
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6