inertia.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /** \file itasc/kdl/inertia.cpp
  2. * \ingroup itasc
  3. */
  4. // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  5. // Version: 1.0
  6. // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  7. // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  8. // URL: http://www.orocos.org/kdl
  9. // This library is free software; you can redistribute it and/or
  10. // modify it under the terms of the GNU Lesser General Public
  11. // License as published by the Free Software Foundation; either
  12. // version 2.1 of the License, or (at your option) any later version.
  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. // You should have received a copy of the GNU Lesser General Public
  18. // License along with this library; if not, write to the Free Software
  19. // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. #include "inertia.hpp"
  21. #include <Eigen/Core>
  22. namespace KDL {
  23. using namespace Eigen;
  24. Inertia::Inertia(double m,double Ixx,double Iyy,double Izz,double Ixy,double Ixz,double Iyz):
  25. data(Matrix<double,6,6>::Zero())
  26. {
  27. data(0,0)=Ixx;
  28. data(1,1)=Iyy;
  29. data(2,2)=Izz;
  30. data(2,1)=data(1,2)=Ixy;
  31. data(3,1)=data(1,3)=Ixz;
  32. data(3,2)=data(2,3)=Iyz;
  33. data.block(3,3,3,3)=m*Matrix<double,3,3>::Identity();
  34. }
  35. Inertia::~Inertia()
  36. {
  37. }
  38. }