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  const Vector& getSpatialMomentum() const
79  {
80  return h;
81  }
82 
86  Vector getCOG() const{
87  if(m==0) return Vector::Zero();
88  else return h/m;
89  };
90 
95  return I;
96  };
97 
98  private:
99  RigidBodyInertia(double m,const Vector& h,const RotationalInertia& I,bool mhi);
100  double m;
103 
105 
106  };
107 
111  RigidBodyInertia operator*(double a,const RigidBodyInertia& I);
118 
123  Wrench operator*(const RigidBodyInertia& I,const Twist& t);
124 
134 
135 
136 
137 }//namespace
138 
139 
140 #endif
represents rotations in 3 dimensional space.
Definition: frames.hpp:303
static Vector Zero()
Definition: frames.hpp:139
6D Inertia of a rigid body
RigidBodyInertia RefPoint(const Vector &p)
represents both translational and rotational velocities.
Definition: frames.hpp:723
6D Inertia of a articulated body
A concrete implementation of a 3 dimensional vector class.
Definition: frames.hpp:162
static const bool mhi
RigidBodyInertia(double m=0, const Vector &oc=Vector::Zero(), const RotationalInertia &Ic=RotationalInertia::Zero())
static RotationalInertia Zero()
static RigidBodyInertia Zero()
RotationalInertia getRotationalInertia() const
const Vector & getSpatialMomentum() const
represents a frame transformation in 3D space (rotation + translation)
Definition: frames.hpp:572
represents both translational and rotational acceleration.
Definition: frames.hpp:881
friend RigidBodyInertia operator+(const RigidBodyInertia &Ia, const RigidBodyInertia &Ib)
friend RigidBodyInertia operator*(double a, const RigidBodyInertia &I)


orocos_kdl
Author(s):
autogenerated on Thu Apr 13 2023 02:19:14