mc_rtc  2.14.0
inertia.h
Go to the documentation of this file.
1 #pragma once
2 #include <mc_rbdyn/api.h>
3 #include <SpaceVecAlg/SpaceVecAlg>
4 
5 namespace mc_rbdyn
6 {
7 
8 /*
9  * Computes the inertia of a box-shaped rigid body.
10  *
11  * Assumptions:
12  * - The box is a solid, homogeneous object.
13  * - The mass is uniformly distributed.
14  * - The inertia is computed about the center of mass.
15  * - The box is aligned with the coordinate axes.
16  *
17  * @param mass Mass of the box.
18  * @param size Dimensions of the box (length, width, height).
19  * @return Inertia of the box as sva::RBInertiad.
20  */
21 MC_RBDYN_DLLAPI sva::RBInertiad computeBoxInertia(double mass, const Eigen::Vector3d & size);
22 
23 /*
24  * Computes the inertia of a sphere-shaped rigid body.
25  *
26  * Assumptions:
27  * - The sphere is solid and homogeneous.
28  * - The mass is uniformly distributed.
29  * - The inertia is computed about the center of mass.
30  *
31  * @param mass Mass of the sphere.
32  * @param radius Radius of the sphere.
33  * @return Inertia of the sphere as sva::RBInertiad.
34  */
35 sva::RBInertiad computeSphereInertia(double mass, double radius);
36 
47 sva::RBInertiad computeCylinderInertia(double mass, double radius, double length);
48 
62 sva::RBInertiad computeSuperEllipsoidInertia(double mass,
63  const Eigen::Vector3d & size,
64  double epsilon1,
65  double epsilon2);
66 
67 } // namespace mc_rbdyn
#define MC_RBDYN_DLLAPI
Definition: api.h:50
Definition: generic_gripper.h:15
sva::RBInertiad computeSphereInertia(double mass, double radius)
sva::RBInertiad computeSuperEllipsoidInertia(double mass, const Eigen::Vector3d &size, double epsilon1, double epsilon2)
Compute the inertia of a superellipsoid by interpolating between box and ellipsoid inertia.
MC_RBDYN_DLLAPI sva::RBInertiad computeBoxInertia(double mass, const Eigen::Vector3d &size)
sva::RBInertiad computeCylinderInertia(double mass, double radius, double length)
Computes the inertia of a solid cylinder.