inertia.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  2. // Version: 1.0
  3. // Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  4. // Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
  5. // URL: http://www.orocos.org/kdl
  6. // This library is free software; you can redistribute it and/or
  7. // modify it under the terms of the GNU Lesser General Public
  8. // License as published by the Free Software Foundation; either
  9. // version 2.1 of the License, or (at your option) any later version.
  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. // You should have received a copy of the GNU Lesser General Public
  15. // License along with this library; if not, write to the Free Software
  16. // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. #ifndef KDLINERTIA_HPP
  18. #define KDLINERTIA_HPP
  19. #include <Eigen/Core>
  20. #include "frames.hpp"
  21. namespace KDL {
  22. using namespace Eigen;
  23. /**
  24. * This class offers the inertia-structure of a body
  25. * An inertia is defined in a certain reference point and a certain reference base.
  26. * The reference point does not have to coincide with the origin of the reference frame.
  27. */
  28. class Inertia{
  29. public:
  30. /**
  31. * This constructor creates a cartesian space inertia matrix,
  32. * the arguments are the mass and the inertia moments in the cog.
  33. */
  34. Inertia(double m=0,double Ixx=0,double Iyy=0,double Izz=0,double Ixy=0,double Ixz=0,double Iyz=0);
  35. static inline Inertia Zero(){
  36. return Inertia(0,0,0,0,0,0,0);
  37. };
  38. friend class Rotation;
  39. friend class Frame;
  40. /**
  41. * F = m*a
  42. */
  43. // Wrench operator* (const AccelerationTwist& acc);
  44. ~Inertia();
  45. private:
  46. Matrix<double,6,6,RowMajor> data;
  47. };
  48. }
  49. #endif