|
Vulcan
Aerospace Engineering Utilities Built on Janus
|
#include <MassProperties.hpp>
Public Member Functions | |
| Mat3< Scalar > | inertia_about_point (const Vec3< Scalar > &point) const |
| MassProperties< Scalar > | operator+ (const MassProperties< Scalar > &other) const |
| MassProperties< Scalar > | operator- (const MassProperties< Scalar > &other) const |
| MassProperties< Scalar > | operator* (const Scalar &factor) const |
| MassProperties< Scalar > | operator/ (const Scalar &factor) const |
| Divide mass properties by a factor. | |
| MassProperties< Scalar > & | operator+= (const MassProperties< Scalar > &other) |
| In-place addition. | |
| Vec3< Scalar > | cg_offset () const |
Static Public Member Functions | |
| static MassProperties< Scalar > | point_mass (const Scalar &m, const Vec3< Scalar > &position) |
| static MassProperties< Scalar > | diagonal (const Scalar &m, const Vec3< Scalar > &cg_pos, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz) |
| static MassProperties< Scalar > | from_components (const Scalar &m, const Vec3< Scalar > &cg_pos, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz, const Scalar &Ixy, const Scalar &Ixz, const Scalar &Iyz) |
| static MassProperties< Scalar > | solid_sphere (const Scalar &m, const Scalar &radius, const Vec3< Scalar > &cg_pos=Vec3< Scalar >::Zero()) |
| static MassProperties< Scalar > | solid_cylinder (const Scalar &m, const Scalar &radius, const Scalar &length, const Vec3< Scalar > &cg_pos=Vec3< Scalar >::Zero()) |
| static MassProperties< Scalar > | solid_box (const Scalar &m, const Scalar &dx, const Scalar &dy, const Scalar &dz, const Vec3< Scalar > &cg_pos=Vec3< Scalar >::Zero()) |
| static MassProperties< Scalar > | from_mass (const Scalar &m) |
| static MassProperties< Scalar > | diagonal (const Scalar &m, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz) |
| static MassProperties< Scalar > | full (const Scalar &m, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz, const Scalar &Ixy, const Scalar &Ixz, const Scalar &Iyz) |
Public Attributes | |
| Scalar | mass |
| Total mass [kg]. | |
| Vec3< Scalar > | cg |
| CG position in body frame [m]. | |
| Mat3< Scalar > | inertia |
| Inertia tensor about CG, in body-fixed axes [kg·m²]. | |
Full mass properties for a rigid body component
All quantities are expressed in body-fixed coordinates:
When passed to dynamics functions like compute_6dof_derivatives(), the mass properties must be consistent with the body frame used for forces, moments, and angular velocity.
Uses the STANDARD mathematical convention:
where Ixy = -∫xy dm (negative product of inertia).
This differs from some CAD tools (SolidWorks, NX) which use opposite signs.
Reference: https://en.wikipedia.org/wiki/Moment_of_inertia#Inertia_tensor
Mass properties can be combined using operator+:
The combined CG is the mass-weighted average, and inertia is computed using the parallel axis theorem. All components must be expressed in the same body frame for aggregation to be meaningful.
|
inline |
Get CG offset from origin (alias for cg)
|
inlinestatic |
Create with diagonal inertia at origin (4-arg overload)
|
inlinestatic |
Create mass properties with diagonal inertia tensor
| m | Mass [kg] |
| cg_pos | CG position [m] |
| Ixx | Principal moment about X [kg·m²] |
| Iyy | Principal moment about Y [kg·m²] |
| Izz | Principal moment about Z [kg·m²] |
|
inlinestatic |
Create mass properties with full 6-component inertia tensor
Products of inertia use POSITIVE convention: Ixy_input = ∫xy dm The function applies negation internally to form the standard tensor.
| m | Mass [kg] |
| cg_pos | CG position [m] |
| Ixx | Moment about X [kg·m²] |
| Iyy | Moment about Y [kg·m²] |
| Izz | Moment about Z [kg·m²] |
| Ixy | Product of inertia (positive convention) [kg·m²] |
| Ixz | Product of inertia (positive convention) [kg·m²] |
| Iyz | Product of inertia (positive convention) [kg·m²] |
|
inlinestatic |
Create from mass only (point mass at origin)
|
inlinestatic |
Create with full inertia at origin (7-arg overload)
|
inline |
Get inertia tensor about an arbitrary point
Uses the parallel axis theorem (tensor generalization): J = I + m * (|r|² * Identity - r ⊗ r)
where r is the vector from the point to the CG.
Reference: https://en.wikipedia.org/wiki/Parallel_axis_theorem#Tensor_generalization
| point | The reference point [m] |
|
inline |
Scale mass properties by a factor
Scales mass and inertia; CG remains unchanged.
|
inline |
Add two mass properties (aggregation)
Computes combined CG as mass-weighted average, then uses parallel axis theorem to express both inertias about the combined CG and sums them.
|
inline |
In-place addition.
|
inline |
Subtract mass properties (hole removal)
Used for modeling holes or removed material.
|
inline |
Divide mass properties by a factor.
|
inlinestatic |
Create a point mass at a specified location
A point mass has zero inertia about its own CG.
| m | Mass [kg] |
| position | CG position [m] |
|
inlinestatic |
Create mass properties for a solid rectangular box
Ixx = (1/12) * m * (dy² + dz²) Iyy = (1/12) * m * (dx² + dz²) Izz = (1/12) * m * (dx² + dy²)
| m | Mass [kg] |
| dx | Width in X [m] |
| dy | Width in Y [m] |
| dz | Width in Z [m] |
| cg_pos | CG position [m] (default: origin) |
|
inlinestatic |
Create mass properties for a solid cylinder (axis along Z)
Ixx = Iyy = (1/12) * m * (3*r² + L²) Izz = (1/2) * m * r²
| m | Mass [kg] |
| radius | Cylinder radius [m] |
| length | Cylinder length along Z [m] |
| cg_pos | CG position [m] (default: origin) |
|
inlinestatic |
Create mass properties for a solid sphere
I = (2/5) * m * r² for all axes
| m | Mass [kg] |
| radius | Sphere radius [m] |
| cg_pos | CG position [m] (default: origin) |
| Vec3<Scalar> vulcan::mass::MassProperties< Scalar >::cg |
CG position in body frame [m].
| Mat3<Scalar> vulcan::mass::MassProperties< Scalar >::inertia |
Inertia tensor about CG, in body-fixed axes [kg·m²].
| Scalar vulcan::mass::MassProperties< Scalar >::mass |
Total mass [kg].