chain_coupling.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 // Modified by Juan A. Corrales (ISIR, UPMC) in order to include coupling
9 
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 
24 #ifndef KDL_CHAIN_COUPLING_HPP
25 #define KDL_CHAIN_COUPLING_HPP
26 
27 #include <kdl/segment.hpp>
28 #include <string>
29 #include <Eigen/Core>
30 #include <kdl/jntarray.hpp>
31 #include <kdl/chain.hpp>
32 
33 namespace KDL
34 {
35 typedef Eigen::MatrixXd (*updateFuncPtr)(const JntArray &q); // Pointer to update function of coupling matrix
36 /*
37 * \brief This class encapsulates a <strong>serial</strong> kinematic
38 * interconnection structure. It is build out of segments.
39 *
40 * @ingroup KinematicFamily
41 */
43  public KDL::Chain
44 {
45 private:
46  unsigned int nrOfIndJoints;
48 public:
49  /*
50  * The constructor of a Chain_coupling, a new Chain_coupling is always empty.
51  *
52  */
54 
55  Chain_coupling(const Chain_coupling &in);
56 
57  explicit Chain_coupling(const Chain &in);
58 
60 
61  Chain_coupling &operator=(const Chain &in);
62 
63  /*
64  * Determines if there is coupling between the joints of a Chain_coupling.
65  * @return true or false if there is or not coupling.
66  */
67  bool isCoupled() const;
68 
69  /*
70  * Gets the function which updates the value of the coupling matrix depending
71  * on the current joint values.
72  * @return pointer to update function.
73 */
75 
76  /*
77  * Sets the function which updates the value of the coupling matrix depending
78  * on the current joint values.
79  * @param updateFunc pointer to the function which implements the coupling update.
80 * @return true if the fucntion generates correct coupling matrices and false otherwise
81 */
83 
84  /*
85  * Calls the update function which changes the coupling matrix according to the
86  * joint values passed as parameter.
87  * @param q array of current joint values.
88  */
89  void updateCoupling(const JntArray &q);
90 
91  /*
92 * Request the total number of independent joints in the Chain_coupling.
93 * It's the Coupling matrix rank.
94 * @return total nr of independ joints
95 */
96  unsigned int getNrOfIndJoints() const
97  {
98  return nrOfIndJoints;
99  };
100 
101  ~Chain_coupling();
102 
103  // Matrix with coupling coefficients between joints
104  Eigen::MatrixXd cm;
105 };
106 } // namespace KDL
107 
108 #endif
unsigned int nrOfIndJoints
void updateCoupling(const JntArray &q)
bool setUpdateCouplingFunction(updateFuncPtr updateFunc)
Chain_coupling & operator=(const Chain_coupling &in)
updateFuncPtr updateFunction
unsigned int getNrOfIndJoints() const
Eigen::MatrixXd cm
updateFuncPtr getUpdateCouplingFunction() const
bool isCoupled() const
Eigen::MatrixXd(* updateFuncPtr)(const JntArray &q)


kdl_coupling
Author(s): Juan Antonio Corrales Ramon (UPMC)
autogenerated on Wed Oct 14 2020 04:05:04