SpatialRigidBodyInertia.hpp
Go to the documentation of this file.
1 /*
2  * RDL - Robot Dynamics Library
3  * Copyright (c) 2017 Jordan Lack <jlack1987@gmail.com>
4  *
5  * Licensed under the zlib license. See LICENSE for more details.
6  */
7 
8 #ifndef __RDL_SPATIAL_RIGID_BODY_INERTIA_HPP__
9 #define __RDL_SPATIAL_RIGID_BODY_INERTIA_HPP__
10 
20 
21 namespace RobotDynamics
22 {
23 namespace Math
24 {
33 {
34  public:
39  {
40  }
41 
47  {
48  }
49 
57  SpatialInertia(ReferenceFramePtr referenceFrame, double mass, const Vector3d& com_mass, const Matrix3d& inertia)
58  : RigidBodyInertia(mass, com_mass, inertia), FrameObject(referenceFrame)
59  {
60  }
61 
74  SpatialInertia(ReferenceFramePtr referenceFrame, double m, const Vector3d& h, const double Ixx, const double Iyx, const double Iyy, const double Izx,
75  const double Izy, const double Izz)
76  : RigidBodyInertia(m, h, Ixx, Iyx, Iyy, Izx, Izy, Izz), FrameObject(referenceFrame)
77  {
78  }
79 
86  {
87  }
88 
94  {
95  }
96 
98  {
99  return this;
100  }
101 
107  {
108  return RigidBodyInertia(this->m, this->h, this->Ixx, this->Iyx, this->Iyy, this->Izx, this->Izy, this->Izz);
109  }
110 
115  void operator+=(const SpatialInertia& spatialInertia)
116  {
117  checkReferenceFramesMatch(&spatialInertia);
118  this->RigidBodyInertia::operator+=(spatialInertia);
119  }
120 
122  {
123  referenceFrame->checkReferenceFramesMatch(a.getReferenceFrame());
124  return RobotDynamics::Math::SpatialForce(referenceFrame, this->timesSpatialVector(a)); // this->RigidBodyInertia::operator*(*this, a));
125  }
126 };
127 
134 inline SpatialInertia operator+(SpatialInertia inertia_a, const SpatialInertia& inertia_b)
135 {
136  inertia_a += inertia_b;
137  return inertia_a;
138 }
139 typedef std::vector<SpatialInertia, Eigen::aligned_allocator<SpatialInertia>> SpatialInertiaV;
140 } // namespace Math
141 } // namespace RobotDynamics
142 
143 #endif //__SPATIAL_RIGID_BODY_INERTIA_HPP__
RigidBodyInertia toRigidBodyInertia() const
Get a copy of a Math::SpatialInertia as type Math::RigidBodyInertia.
ReferenceFramePtr getReferenceFrame() const
Get a pointer to the reference frame this FrameObject is expressed in.
Definition: FrameObject.hpp:52
TransformableGeometricObject * getTransformableGeometricObject()
Pure virtual method that FrameObjects are required to implement so the FrameObject::changeFrame metho...
SpatialInertia(ReferenceFramePtr referenceFrame)
Constructor.
SpatialInertia(ReferenceFramePtr referenceFrame, double mass, const Vector3d &com_mass, const Matrix3d &inertia)
Constructor.
ReferenceFramePtr referenceFrame
Definition: FrameObject.hpp:81
void operator+=(const RigidBodyInertia &rbi)
Overloaded plus-equals operator. Adds two inertia matrices.
FramePoint operator+(FramePoint p, const FrameVector &v)
Definition: FramePoint.hpp:295
See V. Duindum p39-40 & Featherstone p32-33.
void checkReferenceFramesMatch(const FrameObject *frameObject) const
Check if two ReferenceFrameHolders hold the same ReferenceFrame.
Definition: FrameObject.hpp:70
The TransformableGeometricObject class is an essential interface because it forces all geometric obje...
Definition: rdl_eigenmath.h:43
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
This class stores a bodies mass, center of mass, and inertia information. The inertia elements are st...
A Math::SpatialInertia is a RigidBodyInertia explicitly expressed in a RobotDynamics::ReferenceFrame...
SpatialInertia(ReferenceFramePtr referenceFrame, double m, const Vector3d &h, const double Ixx, const double Iyx, const double Iyy, const double Izx, const double Izy, const double Izz)
Constructor.
SpatialInertia()
Empty constructor. Initializes FrameObject::referenceFrame to nullptr.
std::vector< SpatialInertia, Eigen::aligned_allocator< SpatialInertia > > SpatialInertiaV
SpatialAcceleration. For clarity, the ReferenceFrames are stated as follows. A spatial acceleration i...
RobotDynamics::Math::SpatialForce operator*(const RobotDynamics::Math::SpatialAcceleration &a)
A SpatialForce is a spatial vector with the angular part being three moments and the linear part bein...
SpatialInertia(const SpatialInertia &inertia)
Copy constructor.
SpatialInertia(ReferenceFramePtr referenceFrame, const RigidBodyInertia &inertia)
Constructor.
An interface that objects with a ReferenceFrame extend to inherit the FrameObject::changeFrame method...
Definition: FrameObject.hpp:28
Namespace for all structures of the RobotDynamics library.
Definition: Body.h:21
void operator+=(const SpatialInertia &spatialInertia)
Overloaded += operator. Performs frame checks.
SpatialVector timesSpatialVector(const SpatialVector &v) const
Multiply a Math::RigidBodyInertia by a Math::SpatialVector and return the result as a new Math::Spati...


rdl_dynamics
Author(s):
autogenerated on Tue Apr 20 2021 02:25:28