FancySafeBot 0.0.1
A safe robotics library
Loading...
Searching...
No Matches
Rigid Body

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.
 

Detailed Description

Rigid body (link) mass properties and transforms.

Function Documentation

◆ body_combine()

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

Parameters
[in]mass_props_aMass properties of body A
[in]transf_abCoordinate transform from body A to body B
[in]mass_props_bMass properties of body B
Returns
Combined mass properties

◆ body_inertia_principal_axis()

bool fsb::body_inertia_principal_axis ( const Inertia inertia,
PrincipalInertia principal_inertia 
)
Parameters
[in]inertia
[out]principal_inertia
Returns
true
false

◆ body_parallel_axis_inertia()

Inertia fsb::body_parallel_axis_inertia ( real_t  mass,
const Vec3 com,
const Inertia 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} \)

Parameters
[in]massMass of body
[in]comCenter of mass
[in]inertiaInertia tensor with respect to center of mass
Returns
Output inertia tensor with respect to origin

◆ body_rotate_inertia()

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} \)

Parameters
[in]rotRotation quaternion
[in]inertiaInertia tensor
Returns
Rotated inertia tensor

◆ body_transform_mass_props()

MassProps fsb::body_transform_mass_props ( const Transform transf,
const MassProps mass_props 
)

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.

Parameters
[in]transfCoordinate transform from old to new frame
[in]mass_propsMass properties
Returns
Mass properties in new coordinate frame

◆ body_validate_inertia_is_pd()

bool fsb::body_validate_inertia_is_pd ( const Inertia inertia)

Check if inertia tensor is positive definite.

Parameters
inertia
Returns
true
false

◆ inertia_cross_multiply_vector()

Vec3 fsb::inertia_cross_multiply_vector ( const Inertia inertia,
const Vec3 vel 
)

Cross product with inertia tensor and angular velocity.

\( \mathbf{v} = \left[ \omega \right]^{\times} \mathcal{I} \omega \)

Parameters
inertiaInertia tensor
velAngular velocity vector
Returns
Result of cross product and multiplication

◆ inertia_multiply_vector()

Vec3 fsb::inertia_multiply_vector ( const Inertia inertia,
const Vec3 vec 
)

Inertia tensor multiplication with vector.

\( \mathbf{v} = \mathcal{I} \mathbf{w} \)

Parameters
inertiaInertia tensor
vecVector to multiply by inertia tensor
Returns
Result of multiplication