KDL  1.3.0
jntspaceinertiamatrix.hpp
Go to the documentation of this file.
1 // Copyright (C) 2009 Dominick Vanthienen <dominick dot vanthienen at mech dot kuleuven dot be>
2 
3 // Version: 1.0
4 // Author: Dominick Vanthienen <dominick dot vanthienen at mech dot kuleuven dot be>
5 // Maintainer: Dominick Vanthienen <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_JNTSPACEINERTIAMATRIX_HPP
23 #define KDL_JNTSPACEINERTIAMATRIX_HPP
24 
25 #include "frames.hpp"
26 #include "jacobian.hpp"
27 #include "jntarray.hpp"
28 
29 #include <Eigen/Core>
30 
31 namespace KDL
32 {
33  // Equal is friend function, but default arguments for friends are forbidden (ยง8.3.6.4)
34  class JntSpaceInertiaMatrix;
35  bool Equal(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2,double eps=epsilon);
36 
74  class JntSpaceInertiaMatrix
75  {
76  public:
77  Eigen::MatrixXd data;
78 
86  JntSpaceInertiaMatrix();
97  explicit JntSpaceInertiaMatrix(int size);
101  JntSpaceInertiaMatrix(const JntSpaceInertiaMatrix& arg);
102  ~JntSpaceInertiaMatrix();
112  void resize(unsigned int newSize);
113 
114  JntSpaceInertiaMatrix& operator = ( const JntSpaceInertiaMatrix& arg);
122  double operator()(unsigned int i,unsigned int j)const;
130  double& operator()(unsigned int i,unsigned int j);
135  unsigned int rows()const;
139  unsigned int columns()const;
140 
150  friend void Add(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2,JntSpaceInertiaMatrix& dest);
160  friend void Subtract(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2,JntSpaceInertiaMatrix& dest);
170  friend void Multiply(const JntSpaceInertiaMatrix& src,const double& factor,JntSpaceInertiaMatrix& dest);
180  friend void Divide(const JntSpaceInertiaMatrix& src,const double& factor,JntSpaceInertiaMatrix& dest);
193  friend void Multiply(const JntSpaceInertiaMatrix& src, const JntArray& vec, JntArray& dest);
199  friend void SetToZero(JntSpaceInertiaMatrix& matrix);
210  friend bool Equal(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2,double eps);
211 
212  friend bool operator==(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2);
213  //friend bool operator!=(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2);
214  };
215 
216  bool operator==(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2);
217  //bool operator!=(const JntSpaceInertiaMatrix& src1,const JntSpaceInertiaMatrix& src2);
218 
219 }
220 
221 #endif
void Subtract(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:87
void Divide(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:97
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
Definition: jntarray.cpp:82
IMETHOD void SetToZero(Vector &v)
Definition: frames.hpp:1062
IMETHOD bool Equal(const FrameAcc &r1, const FrameAcc &r2, double eps=epsilon)
Definition: frameacc.hpp:394
Definition: articulatedbodyinertia.cpp:28
bool operator==(const Rotation &a, const Rotation &b)
Definition: frames.cpp:388
void Multiply(const JntArray &src, const double &factor, JntArray &dest)
Definition: jntarray.cpp:92