rotationalinertia.cpp
Go to the documentation of this file.
1 // Copyright (C) 2009 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 #include "rotationalinertia.hpp"
23 #include <Eigen/Core>
24 using namespace Eigen;
25 
26 namespace KDL
27 {
28  RotationalInertia::RotationalInertia(double Ixx,double Iyy,double Izz,double Ixy,double Ixz,double Iyz)
29  {
30  data[0]=Ixx;
31  data[1]=data[3]=Ixy;
32  data[2]=data[6]=Ixz;
33  data[4]=Iyy;
34  data[5]=data[7]=Iyz;
35  data[8]=Izz;
36 
37  }
38 
39  RotationalInertia::~RotationalInertia()
40  {
41  }
42 
44  // Complexity : 9M+6A
45  Vector result;
46  Map<Vector3d>(result.data)=Map<const Matrix3d>(this->data)*Map<const Vector3d>(omega.data);
47  return result;
48  }
49 
51  RotationalInertia result;
52  Map<Matrix3d>(result.data)=a*Map<const Matrix3d>(I.data);
53  return result;
54  }
55 
57  RotationalInertia result;
58  Map<Matrix3d>(result.data)=Map<const Matrix3d>(Ia.data)+Map<const Matrix3d>(Ib.data);
59  return result;
60  }
61 }
62 
RotationalInertia operator+(const RotationalInertia &Ia, const RotationalInertia &Ib)
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:160
double data[3]
Definition: frames.hpp:163
RotationalInertia operator*(double a, const RotationalInertia &I)


orocos_kdl
Author(s):
autogenerated on Fri Mar 12 2021 03:05:44