KDL  1.4.0
rigidbodyinertia.hpp
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 #ifndef KDL_RIGIDBODYINERTIA_HPP
23 #define KDL_RIGIDBODYINERTIA_HPP
24 
25 #include "frames.hpp"
26 
27 #include "rotationalinertia.hpp"
28 
29 namespace KDL {
30 
38  public:
39 
44  explicit RigidBodyInertia(double m=0, const Vector& oc=Vector::Zero(), const RotationalInertia& Ic=RotationalInertia::Zero());
45 
49  static inline RigidBodyInertia Zero(){
51  };
52 
53 
55 
56  friend RigidBodyInertia operator*(double a,const RigidBodyInertia& I);
57  friend RigidBodyInertia operator+(const RigidBodyInertia& Ia,const RigidBodyInertia& Ib);
58  friend Wrench operator*(const RigidBodyInertia& I,const Twist& t);
59  friend RigidBodyInertia operator*(const Frame& T,const RigidBodyInertia& I);
60  friend RigidBodyInertia operator*(const Rotation& R,const RigidBodyInertia& I);
61 
67 
71  double getMass() const{
72  return m;
73  };
74 
78  Vector getCOG() const{
79  if(m==0) return Vector::Zero();
80  else return h/m;
81  };
82 
87  return I;
88  };
89 
90  private:
91  RigidBodyInertia(double m,const Vector& h,const RotationalInertia& I,bool mhi);
92  double m;
95 
96  friend class ArticulatedBodyInertia;
97 
98  };
99 
103  RigidBodyInertia operator*(double a,const RigidBodyInertia& I);
110 
115  Wrench operator*(const RigidBodyInertia& I,const Twist& t);
116 
126 
127 
128 
129 }//namespace
130 
131 
132 #endif
KDL::Vector::data
double data[3]
Definition: frames.hpp:163
frames.hpp
KDL::RigidBodyInertia::operator+
friend RigidBodyInertia operator+(const RigidBodyInertia &Ia, const RigidBodyInertia &Ib)
addition I: I_new = I_old1 + I_old2, make sure that I_old1 and I_old2 are expressed in the same refer...
Definition: rigidbodyinertia.cpp:48
KDL::Twist::rot
Vector rot
The rotational velocity of that point.
Definition: frames.hpp:723
KDL::Frame::Inverse
Frame Inverse() const
Gives back inverse transformation of a Frame.
Definition: frames.inl:422
KDL::RigidBodyInertia::getCOG
Vector getCOG() const
Get the center of gravity of the rigid body.
Definition: rigidbodyinertia.hpp:78
KDL::operator*
ArticulatedBodyInertia operator*(double a, const ArticulatedBodyInertia &I)
Scalar product: I_new = double * I_old.
Definition: articulatedbodyinertia.cpp:51
KDL::RotationalInertia::Zero
static RotationalInertia Zero()
Definition: rotationalinertia.hpp:39
KDL::RigidBodyInertia::RefPoint
RigidBodyInertia RefPoint(const Vector &p)
Reference point change with v the vector from the old to the new point expressed in the current refer...
Definition: rigidbodyinertia.cpp:85
KDL::Vector::Zero
static Vector Zero()
Definition: frames.inl:138
KDL::Frame::p
Vector p
origine of the Frame
Definition: frames.hpp:572
KDL::mhi
const static bool mhi
Definition: rigidbodyinertia.cpp:30
KDL::RigidBodyInertia::h
Vector h
Definition: rigidbodyinertia.hpp:93
KDL::RigidBodyInertia::m
double m
Definition: rigidbodyinertia.hpp:92
KDL::ArticulatedBodyInertia
6D Inertia of a articulated body
Definition: articulatedbodyinertia.hpp:40
KDL::RigidBodyInertia::~RigidBodyInertia
~RigidBodyInertia()
Definition: rigidbodyinertia.hpp:54
rotationalinertia.hpp
KDL::RigidBodyInertia
6D Inertia of a rigid body
Definition: rigidbodyinertia.hpp:37
KDL
Definition: articulatedbodyinertia.cpp:28
KDL::Vector
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:160
KDL::Twist
represents both translational and rotational velocities.
Definition: frames.hpp:720
rigidbodyinertia.hpp
KDL::Wrench
represents both translational and rotational acceleration.
Definition: frames.hpp:878
KDL::Frame
Definition: frames.hpp:570
KDL::RotationalInertia
Definition: rotationalinertia.hpp:34
KDL::RigidBodyInertia::getMass
double getMass() const
Get the mass of the rigid body.
Definition: rigidbodyinertia.hpp:71
KDL::RigidBodyInertia::Zero
static RigidBodyInertia Zero()
Creates an inertia with zero mass, and zero RotationalInertia.
Definition: rigidbodyinertia.hpp:49
KDL::Twist::vel
Vector vel
The velocity of that point.
Definition: frames.hpp:722
KDL::Rotation::data
double data[9]
Definition: frames.hpp:304
KDL::RigidBodyInertia::getRotationalInertia
RotationalInertia getRotationalInertia() const
Get the rotational inertia expressed in the reference frame (not the cog)
Definition: rigidbodyinertia.hpp:86
KDL::RigidBodyInertia::RigidBodyInertia
RigidBodyInertia(double m=0, const Vector &oc=Vector::Zero(), const RotationalInertia &Ic=RotationalInertia::Zero())
This constructor creates a cartesian space inertia matrix, the arguments are the mass,...
Definition: rigidbodyinertia.cpp:37
KDL::RotationalInertia::data
double data[9]
Definition: rotationalinertia.hpp:65
KDL::Frame::M
Rotation M
Orientation of the Frame.
Definition: frames.hpp:573
KDL::RigidBodyInertia::I
RotationalInertia I
Definition: rigidbodyinertia.hpp:94
KDL::RigidBodyInertia::operator*
friend RigidBodyInertia operator*(double a, const RigidBodyInertia &I)
Scalar product: I_new = double * I_old.
Definition: rigidbodyinertia.cpp:44
KDL::operator+
ArticulatedBodyInertia operator+(const ArticulatedBodyInertia &Ia, const ArticulatedBodyInertia &Ib)
addition I: I_new = I_old1 + I_old2, make sure that I_old1 and I_old2 are expressed in the same refer...
Definition: articulatedbodyinertia.cpp:55
KDL::Rotation
represents rotations in 3 dimensional space.
Definition: frames.hpp:301