![]() |
FancySafeBot 0.0.1
A safe robotics library
|
Rigid body (link) mass properties and transforms. More...
Classes | |
struct | fsb::Inertia |
Inertia tensor. More... | |
struct | fsb::MassProps |
Mass properties of a body. More... | |
struct | fsb::PrincipalInertia |
Principal inertia of body. More... | |
struct | fsb::BodyCartesianPva |
Container of Cartesian pose, velocity, and acceleration for a list of bodies. More... | |
struct | fsb::Body |
Link body parameters. More... | |
Functions | |
Inertia | fsb::body_rotate_inertia (const Quaternion &rot, const Inertia &inertia) |
Rotate inertia tensor. | |
MassProps | fsb::body_transform_mass_props (const Transform &transf, const MassProps &mass_props) |
Transform mass properties. | |
Inertia | fsb::body_parallel_axis_inertia (real_t mass, const Vec3 &com, const Inertia &inertia) |
Apply parallel axis theorem to inertia tensor. | |
MassProps | fsb::body_combine (const MassProps &mass_props_a, const Transform &transf_ab, const MassProps &mass_props_b) |
Combine mass properties of two bodies in origin of common frame. | |
bool | fsb::body_inertia_principal_axis (const Inertia &inertia, PrincipalInertia &principal_inertia) |
bool | fsb::body_validate_inertia_is_pd (const Inertia &inertia) |
Check if inertia tensor is positive definite. | |
Vec3 | fsb::inertia_multiply_vector (const Inertia &inertia, const Vec3 &vec) |
Inertia tensor multiplication with vector. | |
Vec3 | fsb::inertia_cross_multiply_vector (const Inertia &inertia, const Vec3 &vel) |
Cross product with inertia tensor and angular velocity. | |
Rigid body (link) mass properties and transforms.
MassProps fsb::body_combine | ( | const MassProps & | mass_props_a, |
const Transform & | transf_ab, | ||
const MassProps & | mass_props_b | ||
) |
Combine mass properties of two bodies in origin of common frame.
Inertia is with respect to center of mass
[in] | mass_props_a | Mass properties of body A |
[in] | transf_ab | Coordinate transform from body A to body B |
[in] | mass_props_b | Mass properties of body B |
bool fsb::body_inertia_principal_axis | ( | const Inertia & | inertia, |
PrincipalInertia & | principal_inertia | ||
) |
[in] | inertia | |
[out] | principal_inertia |
Apply parallel axis theorem to inertia tensor.
The inertia tensor about the center of mass is translated to be about center of frame $0$ \( \mathcal{I}_0 = \mathcal{I} - m [\mathbf{p}_{0c}]^{\times} [\mathbf{p}_{0c}]^{\times} \)
[in] | mass | Mass of body |
[in] | com | Center of mass |
[in] | inertia | Inertia tensor with respect to center of mass |
Inertia fsb::body_rotate_inertia | ( | const Quaternion & | rot, |
const Inertia & | inertia | ||
) |
Rotate inertia tensor.
\( \mathbf{I}_0 = \mathbf{R}_{0a} \mathcal{I}_a \mathbf{R}^T_{0a} \)
[in] | rot | Rotation quaternion |
[in] | inertia | Inertia tensor |
Transform mass properties.
The inertia tensor about the center of mass is rotated to the new frame \(0\) from \(a\):
\( \mathbf{I}_0 = \mathbf{R}_{0a} \mathcal{I}_a \mathbf{R}^T_{0a} \)
The center of mass is transformed as
\( \mathbf{p}_{0c} = \mathbf{R}_{0a} \mathbf{p}_{ac} + \mathbf{p}_{0a} \)
and the mass is constant.
[in] | transf | Coordinate transform from old to new frame |
[in] | mass_props | Mass properties |
bool fsb::body_validate_inertia_is_pd | ( | const Inertia & | inertia | ) |
Check if inertia tensor is positive definite.
inertia |
Cross product with inertia tensor and angular velocity.
\( \mathbf{v} = \left[ \omega \right]^{\times} \mathcal{I} \omega \)
inertia | Inertia tensor |
vel | Angular velocity vector |