FancySafeBot 0.0.1
A safe robotics library
Loading...
Searching...
No Matches
fsb_body.h
1
2#ifndef FSB_BODY_H
3#define FSB_BODY_H
4
5#include <array>
6#include "fsb_configuration.h"
7#include "fsb_quaternion.h"
8#include "fsb_motion.h"
9#include "fsb_types.h"
10
11namespace fsb
12{
13
24struct Inertia
25{
27 Real ixx = 0.0;
29 Real iyy = 0.0;
31 Real izz = 0.0;
33 Real ixy = 0.0;
35 Real ixz = 0.0;
37 Real iyz = 0.0;
38};
39
44{
48 Real mass = 0.0;
52 Vec3 com = {};
57};
58
73
78{
82 std::array<CartesianPva, MaxSize::kBodies> body = {};
83};
84
111
121Inertia body_rotate_inertia(const Quaternion& rot, const Inertia& inertia);
122
140MassProps body_transform_mass_props(const Transform& transf, const MassProps& mass_props);
141
153Inertia body_parallel_axis_inertia(Real mass, const Vec3& com, const Inertia& inertia);
154
166 const MassProps& mass_props_a, const Transform& transf_ab, const MassProps& mass_props_b);
167
176bool body_inertia_principal_axis(const Inertia& inertia, PrincipalInertia& principal_inertia);
177
185bool body_validate_inertia_is_pd(const Inertia& inertia);
186
196Vec3 inertia_multiply_vector(const Inertia& inertia, const Vec3& vec);
197
207Vec3 inertia_cross_multiply_vector(const Inertia& inertia, const Vec3& vel);
208
213} // namespace fsb
214
215#endif
MassProps body_transform_mass_props(const Transform &transf, const MassProps &mass_props)
Transform mass properties.
Definition fsb_body.cpp:65
Vec3 inertia_multiply_vector(const Inertia &inertia, const Vec3 &vec)
Inertia tensor multiplication with vector.
Definition fsb_body.cpp:164
bool body_validate_inertia_is_pd(const Inertia &inertia)
Check if inertia tensor is positive definite.
Definition fsb_body.cpp:154
Vec3 inertia_cross_multiply_vector(const Inertia &inertia, const Vec3 &vel)
Cross product with inertia tensor and angular velocity.
Definition fsb_body.cpp:173
bool body_inertia_principal_axis(const Inertia &inertia, PrincipalInertia &principal_inertia)
Definition fsb_body.cpp:113
MassProps 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.
Definition fsb_body.cpp:78
Inertia body_rotate_inertia(const Quaternion &rot, const Inertia &inertia)
Rotate inertia tensor.
Definition fsb_body.cpp:73
Inertia body_parallel_axis_inertia(Real mass, const Vec3 &com, const Inertia &inertia)
Apply parallel axis theorem to inertia tensor.
Definition fsb_body.cpp:53
Container of Cartesian pose, velocity, and acceleration for a list of bodies.
Definition fsb_body.h:78
std::array< CartesianPva, MaxSize::kBodies > body
List of bodies with Cartesian pose, velocity, and acceleration.
Definition fsb_body.h:82
Link body parameters.
Definition fsb_body.h:89
bool is_leaf
true if body is leaf (no children)
Definition fsb_body.h:109
size_t joint_index
Index of parent joint.
Definition fsb_body.h:105
MotionVector origin_offset
Transform offset of from nominal body origin.
Definition fsb_body.h:93
MassProps mass_props
Mass properties of body.
Definition fsb_body.h:97
PrincipalInertia principal_inertia
Principal inertia of body.
Definition fsb_body.h:101
Inertia tensor.
Definition fsb_body.h:25
Real iyz
Iyz component of tensor.
Definition fsb_body.h:37
Real ixz
Ixz component of tensor.
Definition fsb_body.h:35
Real ixx
Ixx component of tensor.
Definition fsb_body.h:27
Real izz
Izz component of tensor.
Definition fsb_body.h:31
Real iyy
Ixx component of tensor.
Definition fsb_body.h:29
Real ixy
Ixy component of tensor.
Definition fsb_body.h:33
Mass properties of a body.
Definition fsb_body.h:44
Inertia inertia
Inertia tensor.
Definition fsb_body.h:56
Real mass
Mass of body.
Definition fsb_body.h:48
Vec3 com
Center of mass.
Definition fsb_body.h:52
Motion vector.
Definition fsb_motion.h:37
Principal inertia of body.
Definition fsb_body.h:63
Inertia inertia
Principal inertia values. Ixy, Ixz, and Iyz are zero.
Definition fsb_body.h:71
Quaternion rot
Orientation of principal inertia axes.
Definition fsb_body.h:67
Unit quaternion.
Definition fsb_quaternion.h:24
Coordinate transform.
Definition fsb_motion.h:22
3D vector
Definition fsb_types.h:27