Orocos KDL
chainjnttojacdotsolver.hpp
1/*
2 Computes the Jacobian time derivative
3 Copyright (C) 2015 Antoine Hoarau <hoarau [at] isir.upmc.fr>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20
21#ifndef KDL_CHAINJNTTOJACDOTSOLVER_HPP
22#define KDL_CHAINJNTTOJACDOTSOLVER_HPP
23
24#include "solveri.hpp"
25#include "frames.hpp"
26#include "jntarrayvel.hpp"
27#include "jacobian.hpp"
28#include "chain.hpp"
29#include "framevel.hpp"
30#include "chainjnttojacsolver.hpp"
31#include "chainfksolverpos_recursive.hpp"
32
33namespace KDL
34{
35
49{
50public:
51 static const int E_JAC_DOT_FAILED = -100;
52 static const int E_JACSOLVER_FAILED = -101;
53 static const int E_FKSOLVERPOS_FAILED = -102;
54
55 // Hybrid representation ref Frame: base, ref Point: end-effector
56 static const int HYBRID = 0;
57 // Body-fixed representation ref Frame: end-effector, ref Point: end-effector
58 static const int BODYFIXED = 1;
59 // Inertial representation ref Frame: base, ref Point: base
60 static const int INERTIAL = 2;
61
62 explicit ChainJntToJacDotSolver(const Chain& chain);
72 virtual int JntToJacDot(const KDL::JntArrayVel& q_in, KDL::Twist& jac_dot_q_dot, int seg_nr = -1);
82 virtual int JntToJacDot(const KDL::JntArrayVel& q_in, KDL::Jacobian& jdot, int seg_nr = -1);
83 int setLockedJoints(const std::vector<bool>& locked_joints);
84
110 void setRepresentation(const int& representation);
111
114
116 virtual const char* strError(const int error) const;
117
118
119protected:
129 const unsigned int& joint_idx,
130 const unsigned int& column_idx);
140 const unsigned int& joint_idx,
141 const unsigned int& column_idx);
151 const unsigned int& joint_idx,
152 const unsigned int& column_idx);
163 const unsigned int& joint_idx,
164 const unsigned int& column_idx,
165 const int& representation);
166private:
167
168 const Chain& chain;
169 std::vector<bool> locked_joints_;
170 unsigned int nr_of_unlocked_joints_;
171 ChainJntToJacSolver jac_solver_;
172 Jacobian jac_;
173 Jacobian jac_dot_;
174 int representation_;
176 Frame F_bs_ee_;
177 Twist jac_dot_k_;
178 Twist jac_j_, jac_i_;
179 Twist t_djdq_;
180};
181
182}
183#endif
Definition chainfksolverpos_recursive.hpp:37
virtual const char * strError(const int error) const
static const int E_FKSOLVERPOS_FAILED
Definition chainjnttojacdotsolver.hpp:53
const Twist & getPartialDerivative(const Jacobian &J, const unsigned int &joint_idx, const unsigned int &column_idx, const int &representation)
Computes .
void setHybridRepresentation()
JntToJacDot() will compute in the Hybrid representation (ref Frame: base, ref Point: end-effector).
Definition chainjnttojacdotsolver.hpp:91
virtual int JntToJacDot(const KDL::JntArrayVel &q_in, KDL::Twist &jac_dot_q_dot, int seg_nr=-1)
Computes .
void setInertialRepresentation()
JntToJacDot() will compute in the Inertial representation (ref Frame: base, ref Point: base).
Definition chainjnttojacdotsolver.hpp:103
ChainJntToJacDotSolver(const Chain &chain)
static const int HYBRID
Definition chainjnttojacdotsolver.hpp:56
static const int E_JAC_DOT_FAILED
Definition chainjnttojacdotsolver.hpp:51
const Twist & getPartialDerivativeHybrid(const Jacobian &bs_J_ee, const unsigned int &joint_idx, const unsigned int &column_idx)
Computes .
virtual void updateInternalDataStructures()
const Twist & getPartialDerivativeBodyFixed(const Jacobian &ee_J_ee, const unsigned int &joint_idx, const unsigned int &column_idx)
Computes .
void setBodyFixedRepresentation()
JntToJacDot() will compute in the Body-fixed representation (ref Frame: end-effector,...
Definition chainjnttojacdotsolver.hpp:97
int setLockedJoints(const std::vector< bool > &locked_joints)
static const int BODYFIXED
Definition chainjnttojacdotsolver.hpp:58
virtual int JntToJacDot(const KDL::JntArrayVel &q_in, KDL::Jacobian &jdot, int seg_nr=-1)
Computes .
static const int E_JACSOLVER_FAILED
Definition chainjnttojacdotsolver.hpp:52
static const int INERTIAL
Definition chainjnttojacdotsolver.hpp:60
void setRepresentation(const int &representation)
Sets the internal variable for the representation (with a check on the value).
const Twist & getPartialDerivativeInertial(const Jacobian &bs_J_bs, const unsigned int &joint_idx, const unsigned int &column_idx)
Computes .
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
represents a frame transformation in 3D space (rotation + translation)
Definition frames.hpp:572
Definition jacobian.hpp:37
Definition jntarrayvel.hpp:46
SolverI()
Initialize latest error to E_NOERROR.
Definition solveri.hpp:111
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